vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Search: Auto shut off based on server load? (https://vborg.vbsupport.ru/showthread.php?t=35200)

kontrabass 02-18-2002 04:13 PM

Would it be possible to implement a feature, where the search is automatically shut off if the server load reaches a preset number? This would be a great "buffer", so that maybe the "Server load too high" messages would be less frequent.

I've got a bit of a load problem, and if a lot of people search when the server load is already high, it skyrockets and then users get the "server too busy" error (I set the load at 6 in my CP).

Thanks!

Paul

Admin 02-18-2002 04:15 PM

Try this. In global.php, find this:
Code:

  if (trim($loadavg[0])>$loadlimit) {
    $servertoobusy=1;
  }

and add this right after that:
Code:

  if (trim($loadavg[0])>XXXXX) {
    $enablesearches=0;
  }

where XXXXX is the load limit you want turn off search on.

kontrabass 02-19-2002 08:08 PM

FireFly:

Thank you! It works great. This will really help to eliminate load spikes. A great and simple hack.

Overgrow 03-08-2002 07:43 PM

See this discussion here to make this useful to sites that have two servers, one for web and one for database:

http://www.vbulletin.com/forum/showt...threadid=41401

Zzed 03-12-2002 05:25 PM

I just put in this hack. It works like a charm. :)

Thanks FireFly. :)

veedee 04-27-2002 03:13 PM

I cant find this under admin/global.php

:confused:

veedee 04-29-2002 11:18 AM

I'm running 2.2.4 btw!

Cheers

Sparkz 04-29-2002 11:46 AM

Since I am reinstalling my portable right now, and I don't have an ssh-client available at this comp, I can't check this, but I would think you should look in the global.php in your forum root.

waddy 07-25-2002 03:45 PM

Hi I have tried this on Version 2.6.6 and it doesnt work at all

Can you please advise

thanks

Tim Wheatley 05-19-2003 05:42 PM

This works fine, it's global.php NOT admin/global.php, as it says in FF's post.

juanmalaga9 10-06-2003 07:24 PM

Quote:

Originally Posted by Chen
Try this. In global.php, find this:
Code:

  if (trim($loadavg[0])>$loadlimit) {
    $servertoobusy=1;
  }

and add this right after that:
Code:

  if (trim($loadavg[0])>XXXXX) {
    $enablesearches=0;
  }

where XXXXX is the load limit you want turn off search on.


And the values of "XXXXX"... are in what way?.

Into the "home" of the Control Panel of vbulletin y can check my server load... always are between 2 and 3... I want to stop the search when the serverload up to 4 and more... like 4.20, 4.35, 5.10 etc.

What i have to put into the "XXXXXX".
Sorry for the question, but i'm a little newbie.

Gary King 10-07-2003 01:31 AM

This is over a year and a half, should make a new thread instead.


All times are GMT. The time now is 07:27 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01133 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (12)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete