Disabling search during heavy loads
This modification is in the archives.
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')); } 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 |