PDA

View Full Version : big load do error


Dj Sagi
04-05-2009, 11:29 PM
how i do that if in my forum
when i someone have big load something like 40 second it appear error?
thx for helps!
srry for bad eng.

Lynne
04-06-2009, 02:44 AM
There may be a modification where it will disallow certain usergroups if your server gets over a certain load. Try a search on "load" or "server" or "usergroup" in "all mods" "titles only"

Dj Sagi
04-06-2009, 01:12 PM
I DONT FOND Restrict search
but i want that no only in search i show, i want that it show error in all my forum that they can enter to nothing and it show error.
how i do it?
thx

Lynne
04-06-2009, 01:35 PM
I'm sorry, I don't understand what you want. vB does not have anything built in to restrict users based on the server load. I did see modifications by searching on "load" in "all mods" "titles only" that deal with server loads. I'm not sure if one of those is what you want. Maybe you can modify it to do what you want.

Dj Sagi
04-06-2009, 02:13 PM
can i get link?
thx.

Lynne
04-06-2009, 02:20 PM
I'm not gonna link to all the threads that come up in the search. Try a search for "load*" in "all mods" "titles only" The search bar is in the upper right corner.

Dj Sagi
04-06-2009, 02:26 PM
i found some
$search_load = intval($vbulletin->options['RestrictSearchs_max_load']);

if ($search_load <= 0) {

$search_load = 5;

}


if (( $vbulletin->userinfo['usergroupid'] <> 6 ) )

{


if ($load = @file_get_contents("/proc/loadavg"))

{

$loadavg = explode(' ', $load);


}elseif ($load=@exec('uptime'))

{
preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$load, $loadavg);


}
elseif ($load = @`sysctl vm.loadavg|cut -d" " -f3-5`)

{

$loadavg = explode(' ', $load);

}


if (trim($loadavg[0]) > $search_load)

{

eval(standard_error( fetch_error('restrict_search')));

}
how i change it that when i have high load appear error in all web?
that can enter to nothing...

thx for help!

Lynne
04-06-2009, 02:45 PM
That looks like code out of a modification. Did you install it? It looks like you set the load in the vboptions and then it gives an error when trying to use search. The variables are all there, you can change it however you want. You should play with the code on your test site to get it right.

Dj Sagi
04-06-2009, 02:54 PM
That looks like code out of a modification. Did you install it? It looks like you set the load in the vboptions and then it gives an error when trying to use search. The variables are all there, you can change it however you want. You should play with the code on your test site to get it right.

you right it restirect search when high load for server....

how i can change it for that it show error in the web not in the search when the server have high load?
thx a lot!
u really really help me!

Lynne
04-06-2009, 03:11 PM
I don't know exactly what you need to do. Find a page that gives the error message you want and then find that code in the page and put it in your new modification OR write your own error phrase and use it in the code. I don't know what hook that code is using, but you'll want to use a more global hook instead of a search hook (if that is the case there).

As I said before, play with it on a test site.

Dj Sagi
04-06-2009, 03:38 PM
thx u very much!
i succees!
thx!