PHP function sys_getloadavg()
Example:
Version availability: PHP 5.1.3
Gets the average system load. Same values as you know from the htop tool in Linux.
Example:
$load = sys_getloadavg();
if ($load[0] > 0.80) { // is the load greater than 80%?
header('HTTP/1.1 503 Too busy, try again later');
die('Server is overloaded, try again later.');
}
Parameters
The function has no input parameters.
Return values
array
Array with three samples (last 1 minute, 5 minutes and 15 minutes).
Other resources
Loading comments...