vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Disable certain forums under heavy load? (https://vborg.vbsupport.ru/showthread.php?t=82097)

Kevlar 05-26-2005 11:54 PM

Disable certain forums under heavy load?
 
I saw a hack out there that allows you to disable the search feature under heavy load (user defineable)... so I'd imagine this would be possible with similar code. Would it be possible to disable certain forums (not all of 'em) under a user defined load? For example... we have our forums set to a *nix load of 10 for the entire board.

However, I would like to say set a *nix limit of 5 for the "off-topic/chitchat" board. Anybody have any ideas?

Andreas 05-27-2005 12:32 AM

Cheepo-Solution:

Place this in Template phpinclude_start
PHP Code:

$filestuff = @file_get_contents('/proc/loadavg');
$loadavg = @explode(' '$filestuff);
if (
trim($loadavg[0]) > 5) {
  
$bbuserinfo['forumpermissions'][ID] = 0;


ID must be replaced with the ID of your "chitchat"-forum.

Kevlar 05-27-2005 01:50 AM

Not to be picky... but would there anyway to send them to the "server is busy page" instead of the user is denied page?

I can just see it now, I'd be getting hundreds of PMs asking why they were denied from the chitchat forum.

Andreas 05-27-2005 02:07 AM

PHP Code:

$filestuff = @file_get_contents('/proc/loadavg');
$loadavg = @explode(' '$filestuff);
if (
trim($loadavg[0]) > 5) {
  
$bbuserinfo['forumpermissions'][ID] = 0;
  
define('SERVER_OVERLOADED''yes');


Then in Template STANDARD_ERROR
HTML Code:

<if condition="SERVER_OVERLOADED == 'yes'">
Your Overloaded, Sorry, Visit later Text here
<else />
Prior Content of STANDARD_ERROR here
</if>


Kevlar 05-27-2005 12:20 PM

Excellent, I will give this a try...


All times are GMT. The time now is 10:09 PM.

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.01139 seconds
  • Memory Usage 1,727KB
  • 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
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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