Back to vBulletin 3.0 Add-Ons

Disabling search during heavy loads
Mod Version: 1.00, by MPDev

This modification is in the archives.
vB Version: 3.0.7 Rating: (0 vote - 0 average) Installs: 8
Released: 10 May 2005 Last Update: Never Downloads: 0
Not Supported  

From 3pm-6pm every day I get a very high level of traffic that sends my server load into the 40s (unless I use the server load limit, which then gives alot of people th busy message). With about 750 or so people online, one of the issues appears to be use of the SEARCH feature which locks a table and starts a backup of requests. So, I added some additional code to search.php:

Code:
// server too busy?
$toobusy = false;
if (@file_exists('/proc/loadavg') AND $filestuff = @file_get_contents('/proc/loadavg'))
{
        $loadavg = explode(' ', $filestuff);
        if (trim($loadavg[0]) > 20)
        {
           $toobusy = true;
        }
}
if ( !$vboptions['enablesearches'] || $toobusy )
{
        eval(print_standard_error('error_searchdisabled'));
}
which will disable the search feature whenever my server load gets above 20. This is seperate from the load limit in the admin and doesn't stop people from using the site, just search. (I changed the searchdisbaled phrase to include a polite message taht search was unavailable during high levels of activity).

Thought someone else might find this useful (you can change the 20 varibale to suit your needs).

PS: I finally configured my server with both Apache and thttpd running and once DNS is updated, I'm going to offload my images onto the thttpd setup to see how that helps with overall loads.

Download

No files for download.

Similar Mods

3.6 Heavy Metal vBulletin 3.6 Styles
3.8 Heavy Metal vBulletin 3.8 Styles
Bass Heavy Skin vBulletin 3.6 Styles
3.5 Heavy Metal vBulletin 3.5 Styles

vblts.ru supports vBulletin®, 2022-2024