sys_getloadavg

(no version information, might be only in CVS)

sys_getloadavg -- Gets system load average

说明

array sys_getloadavg ( void )

Returns three samples representing the average system load (the number of processes in the system run queue) over the last 1, 5 and 15 minutes, respectively.

返回值

Returns an array with three samples (last 1, 5 and 15 minutes).

范例

例 1. A sys_getloadavg() example

<?php
$load
= sys_getloadavg();
if (
$load[0] > 80) {
    
header('HTTP/1.1 503 Too busy, try again later');
    die(
'Server too busy. Please try again later.');
}
?>

注释

注意: 本函数未在 Windows 平台下实现。