View Full Version : Close Search during high server load
With this plug-in installed you can disable your search engine when the server load gets to high. This plug-in add's a new vBoption in the Sever Settings page where you can define your server load.
This plug-in acts exactly like the regular server load limiter but only works on search.php.
Version History
Current Version: 1.0.1
Added installer, no other changes between this and 1.0.0. If you already have 1.0.0 installed there is no reason to upgrade!
Past Versions:
1.0.0:
Released Code to public
Flexo
06-17-2005, 08:19 PM
Do I see this right that this plugin itself uses 3 SQL queries? If so, only when the search.php is loaded or with every PI?
Andreas
06-17-2005, 08:22 PM
The Plugin does not use any Queries at all.
The queries are only necessary once to create the new Setting and the Phrases for this setting.
Flexo
06-17-2005, 08:35 PM
The queries are only necessary once to create the new Setting and the Phrases for this setting.
No idea what this means...
The Plugin does not use any Queries at all.
... but this I get ;)
Thanks.
Andreas
06-17-2005, 08:40 PM
Those 3 Queries from the Readme create a new Setting (in ACP / vBulletin Options / vBulletin Options / Server Settings & Optimization Options) and insert the Text that should be displayed for this setting.
Flexo
06-17-2005, 09:39 PM
Ah, ok, thanks a lot.
Christine
06-23-2005, 12:54 AM
Thanks for porting this!
I've added a installer script and dubbed the new version 1.0.1. There are no code changes so if you already installed this hack you are already running 1.0.1.
JamesFrost
06-27-2005, 08:27 AM
I've added a installer script and dubbed the new version 1.0.1. There are no code changes so if you already installed this hack you are already running 1.0.1.
great idea - could something similar be done with sendmail.php, to only send emails when the server load is at an acceptable level?
Dean C
06-27-2005, 09:30 AM
Fixed the type in your thread title Brad ;)
MPDev
06-28-2005, 06:04 PM
Nice, I did this for 3.0 here (https://vborg.vbsupport.ru/showthread.php?t=81259).
peterska2
07-23-2005, 04:45 PM
Hey Brad :)
You have a typo in line 16 of your installer. You have PREIX instead of PREFIX.
Other than that, installs like a dream :)
Good Work :)
Hey Brad :)
You have a typo in line 16 of your installer. You have PREIX instead of PREFIX.
Other than that, installs like a dream :)
Good Work :)
Thanks for letting me know, zip file updated.
I updated it with my mom's pos dell so let me know if it is still wrong or has any other errors. :)
peterska2
07-23-2005, 05:29 PM
Apart from that one little thing it ran smoothly. Nothing to worry about for you there.
lazytown
12-06-2005, 08:24 AM
Very useful and goes along nicely with some other plugins/mods that use the search feature a lot. It could be a little easier to install with a description of where the options are, what exactly to do, etc.
Developer
12-08-2005, 07:08 PM
powerful hack
installed
Installed this, where exactly do I go to set the load limit? Thanks
kommuni
12-16-2005, 11:21 PM
Installed this, where exactly do I go to set the load limit? Thanks
also can't find it under the serversettings :(
HeRCuL70
12-17-2005, 07:05 PM
sorry, is this hack working with windows 2003? It seems for lunix server. doesnt it?
lazytown
12-21-2005, 11:57 PM
What's the difference between this mod and the other one here
https://vborg.vbsupport.ru/showthread.php?t=102882&highlight=search+load
-vissa
bada_bing
01-11-2006, 07:02 PM
Two questions before I download.
Will this hack work on a Windows Server?
Also is there a way to code this so that the search feature is only available for certain usergroups at HIGH Server load?
For example if the threshhold is high on the server instead of denying everyone access to search to only deny certain usergroups. so that if the server is at a high rate then the admins, mods & Premium Members can still search but everyone else get a server load high message or chaeck back whatever you want to display as a message?
bada_bing
02-03-2006, 02:55 PM
Can someone answer my questions please
bada_bing
02-07-2006, 02:23 AM
Nice hack to bad there is no support..
MissKalunji
02-23-2006, 04:50 AM
installed will be testing soon
MissKalunji
02-23-2006, 05:02 AM
what do i input in : Search Server Load Limit
Just like the *NIX load limit setting, but only prevents access to searching when the server load is to high
Drache
02-23-2006, 07:24 AM
This looks like a very useful plugin thanks. :D
What do you suggest to set the server load limit for search? 5? 10?
beano33
02-24-2006, 08:29 PM
great idea - could something similar be done with sendmail.php, to only send emails when the server load is at an acceptable level?
I'd add display users online, display users browsing forums, and display users browsing threads to that as well.
ThorstenA
03-28-2006, 09:40 AM
I would like not to disable search forums in busy times, but increase the time between search queries.
Snake
03-28-2006, 12:06 PM
Awesome, I find this very useful!
DementedMindz
04-16-2006, 02:59 AM
question is how do we remove it? if we no longer want it?
vBB-vietnam
04-16-2006, 08:00 AM
Is it only active with Linux Server ?
Bieddos
05-05-2006, 08:25 AM
sorry but... where i can set the limit for search nix load???
Bieddos
05-09-2006, 12:39 PM
sorry but... where i can set the limit for search nix load???
no support for 3.5.4... this option there isn't in server option.... is not this hack compatible with 3.5.4???
DementedMindz
06-22-2006, 03:43 PM
ok brad ill ask again... how do we remove it? if we no longer want it?
zooman
07-02-2006, 11:57 AM
anyone tested on 3.6
Ghanem
09-01-2006, 06:45 PM
anyone tested on 3.6Any one please :)
Cybershaolin
12-12-2006, 12:47 AM
Does it work with 3.6.4?
I just got it working in my test/dev 3.6.4. forum and will be installing in my live forums. Works like a champ too!
I had to make the following changes to the loo_sql_searchplug.php though. (Please note) I'm not the author so I hope it is OK to show how I got it to work, plus I can not support either. Sorry.
Too bad this is not a standard "out-of-the-box" feature for vB.
Original
// add phrases to master set
$db->query_write("INSERT INTO " . TABLE_PREFIX . "phrase (languageid, phrasetypeid, varname, text) VALUES ('-1', '5000', 'setting_searchloolimit_desc', 'Just like the *NIX load limit setting, but only prevents access to searching when the server load is too high')");
$db->query_write("INSERT INTO " . TABLE_PREFIX . "phrase (languageid, phrasetypeid, varname, text) VALUES ('-1', '5000', 'setting_searchloolimit_title', 'Search Server Load Limit')");NEW
$db->query_write("INSERT INTO " . TABLE_PREFIX . "phrase (languageid, phraseid, varname, text, product, fieldname) VALUES ('-1', '5000', 'setting_searchloolimit_desc', 'Just like the *NIX load limit setting, but only prevents access to searching when the server load is to high', 'vbulletin', 'vbsettings')");
$db->query_write("INSERT INTO " . TABLE_PREFIX . "phrase (languageid, phraseid, varname, text, product, fieldname) VALUES ('-1', '5001', 'setting_searchloolimit_title', 'Search Server Load Limit', 'vbulletin', 'vbsettings')");
Since this will display the same busy message, I also changed my "toobusy" phrase to:
If you tried to perform a search and received this message, then the server load is a little too high to complete your request at this time.
If you were not conducting a search, then the server load has reached a critical point and needs to unload. Please try again in a few minutes.
I would have to track down fetching of the error code to display a different message solely for this hack, but I think I may leave things as they are. (Is it worth the time figuring it out just to have a separate message????)
Cybershaolin
12-18-2006, 03:46 AM
Well, many people asked the question but I never saw any answer yet.
What value do you put in the server load settings? Let say I just want to test if it's working, what would be the value for that and what would be the regular value to use in overload charge?
What I did was to enter a value less than the actual server load at the time in my dev forum. My server was running about .8 so I typed in .2 Then I tried to do a search in my test forum and was given the error message. Since I had the admin screen opened in another window, I would type in a setting higher than actual load and I was able to search. Once I determined everything was working properly, I installed it in my live forums.
In my live forums I have high NIX load set at 5 and disable searches set at 2.0
Cybershaolin
12-18-2006, 06:08 PM
Thanks for the tip. Just one more question, where can you see the actual server load? You said you saw yours at .8, how do you see that, do you mean the value in our cpanel, plesk or whatever...?
Just Telnet in and do a "top" command. If you can't do this because of being on a shared server, etc. then I suppose the only way would be to see what a snapshot of the current load is when you first load your admincp.
lazytown
02-24-2007, 08:16 AM
I made the changes Indy suggested and it did work with 3.6.4 (with some minor server tweaks).
WARNING: At first I thought this wasn't working but it turns out you need to allow access to the /proc directory with php. If you have" php open_basedir Security" enabled, you will need to disable it for your forum/domain in order to get this to work. It will probably only work if you own your own server as hosts may not allow this. Disabling this security protection for your domain is a slight security risk if your domain gets hacked or is vulnerable. There should be another way to have a mod like this that doesn't need access to /proc.
-vissa
Hornstar
07-23-2007, 04:41 AM
Is a shame this is not supported/default/extended apart from that, it is very nice. thanks.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.