The Arcive of vBulletin Modifications Site. |
|
Restrict search when the server load is high Details »»
|
||||||||||||||||||||||||||||
|
Restrict search when the server load is high
Developer Last Online: Mar 2013
From experience searches on large forums can slow the server down a lot.
Here's a dead simple hack that lets you disable searches when the load average reaches a defined level. Moderators are exempt from the search ban. There's are just two changes to be made: in search.php find: PHP Code:
PHP Code:
You may also wish to change the searchdisabled phrase to something like: Quote:
Show Your Support
|
||||||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
nice hack maybe i'll install it
|
|
#3
|
||||
|
||||
|
hmm.. interesting. thanks for sharing. I may install this later, though my site is on a shared server and loads can get pretty dang high
|
|
#4
|
||||
|
||||
|
Be really interested to get everyone's feedback on how well this has worked for you.
|
|
#5
|
||||
|
||||
|
I just installed it.. and the search feature stopped working alltogether. All I get now is a blank page.
Did some debugging and it's harfing somewhere after the first IF, won't even display a print after the if statement and nothing inside it. Here's where it seems to die on me: @file_get_contents('/proc/loadavg'). |
|
#6
|
||||
|
||||
|
Quote:
It'd be great if you could drop me a PM with some further error message/debug Jen. It definitely shouldn't present you with a blank page. |
|
#7
|
||||
|
||||
|
PM Inbound UK. I'm running Redhat and /proc/loadavg exists, I'm wondering if it can get the file contents though.
|
|
#8
|
||||
|
||||
|
Interesting...
|
|
#9
|
||||
|
||||
|
where do I set the average server load number?
|
|
#10
|
||||
|
||||
|
Quote:
at the top. Where 5 is a one minute load average of 5. |
![]() |
|
|