Can you help me write a script that hits the limit
time for 3.x rotorcms. I want some smaller hits
500. If you exceed the 500 will notice the entrance: the site is overloaded, please visit a few minutes
function server_busy($numer){
if (PHP_OS == ‘Linux’ AND @file_exists(‘/proc/loadavg’) AND $filestuff =@file_get_contents(‘/proc/loadavg’)){
$loadavg = explode(‘ ’, $filestuff);
if (trim($loadavg[0]) > $numer) {
print ‘the site is overloaded, please visit a few minutes….’;
exit(0);
}
}
}
$srv = server_busy(500);
?>
I'm using 3.3.2 Rotorcms
code above does not work, please help me edit it,
Изменил: QuyCuong (07.05.2013 / 07:45)