PDA

View Full Version : Disabling search during heavy loads


MPDev
10 May 2005, 17:47
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



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.

Polo
10 May 2005, 19:15
Nice, thanks for sharing, I konw I will use it one day when my website becomes big ;)

FightRice.com
10 May 2005, 19:35
Hopefully my site becomes big enough i can use this

Nordinho
11 May 2005, 00:03
thanks, very usefull for peaktimes!!

Remi
11 May 2005, 00:12
Great, Can you kindly add a field on the setting section to control the load from there, just like the "NIX Server Load Limit" option.

Thanks

MPDev
11 May 2005, 02:40
After running for a few days this appears to be having a positive effect on keeping my load in check - and those pesky "server too busy" messages are a thing of the past.

I also offloaded the images onto another domain which I am running thttpd on (on the same server as apache); this appears to be having a dramatic effect during peak times where 700+ users are online - my server load is half what it was before offloading and using this mod and my page generation times have been cut in half.

greenhybrid
11 May 2005, 03:24
Where in search.php does this go?

MPDev
11 May 2005, 13:34
Look for the code that is not in bold and add it to that part.

David Bott
25 May 2005, 14:59
Thank you kindly. I had this for ver 2 and it worked great! This should be part of VB all together. ;)