PDA

View Full Version : Search: Auto shut off based on server load?


kontrabass
02-18-2002, 04:13 PM
Would it be possible to implement a feature, where the search is automatically shut off if the server load reaches a preset number? This would be a great "buffer", so that maybe the "Server load too high" messages would be less frequent.

I've got a bit of a load problem, and if a lot of people search when the server load is already high, it skyrockets and then users get the "server too busy" error (I set the load at 6 in my CP).

Thanks!

Paul

Admin
02-18-2002, 04:15 PM
Try this. In global.php, find this:
if (trim($loadavg[0])>$loadlimit) {
$servertoobusy=1;
}
and add this right after that:
if (trim($loadavg[0])>XXXXX) {
$enablesearches=0;
}
where XXXXX is the load limit you want turn off search on.

kontrabass
02-19-2002, 08:08 PM
FireFly:

Thank you! It works great. This will really help to eliminate load spikes. A great and simple hack.

Overgrow
03-08-2002, 07:43 PM
See this discussion here to make this useful to sites that have two servers, one for web and one for database:

http://www.vbulletin.com/forum/showthread.php?s=&threadid=41401

Zzed
03-12-2002, 05:25 PM
I just put in this hack. It works like a charm. :)

Thanks FireFly. :)

veedee
04-27-2002, 03:13 PM
I cant find this under admin/global.php

:confused:

veedee
04-29-2002, 11:18 AM
I'm running 2.2.4 btw!

Cheers

Sparkz
04-29-2002, 11:46 AM
Since I am reinstalling my portable right now, and I don't have an ssh-client available at this comp, I can't check this, but I would think you should look in the global.php in your forum root.

waddy
07-25-2002, 03:45 PM
Hi I have tried this on Version 2.6.6 and it doesnt work at all

Can you please advise

thanks

Tim Wheatley
05-19-2003, 05:42 PM
This works fine, it's global.php NOT admin/global.php, as it says in FF's post.

juanmalaga9
10-06-2003, 07:24 PM
Try this. In global.php, find this:
if (trim($loadavg[0])>$loadlimit) {
$servertoobusy=1;
}
and add this right after that:
if (trim($loadavg[0])>XXXXX) {
$enablesearches=0;
}
where XXXXX is the load limit you want turn off search on.


And the values of "XXXXX"... are in what way?.

Into the "home" of the Control Panel of vbulletin y can check my server load... always are between 2 and 3... I want to stop the search when the serverload up to 4 and more... like 4.20, 4.35, 5.10 etc.

What i have to put into the "XXXXXX".
Sorry for the question, but i'm a little newbie.

Gary King
10-07-2003, 01:31 AM
This is over a year and a half, should make a new thread instead.