首页 >函数列表 >sys_getloadavg

sys_getloadavg

sys_getloadavg

(PHP 5 >= 5.1.3)

sys_getloadavgGets 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).

范例

Example #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.');
}
?>

注释

Note: 此函数未在 Windows 平台下实现。


  • connection_aborted
  • connection_status
  • connection_timeout
  • constant
  • define
  • defined
  • die
  • eval
  • exit
  • highlight_file
  • highlight_string
  • ignore_user_abort
  • pack
  • php_check_syntax
  • php_strip_whitespace
  • show_source
  • sleep
  • sys_getloadavg
  • time_nanosleep
  • time_sleep_until
  • uniqid
  • unpack
  • usleep
  • __halt_compiler
  • PHP MySQL HTML CSS JavaScript MSSQL AJAX .NET JSP Linux Mac ASP 服务器 SQL jQuery C# C++ java Android IOS oracle MongoDB SQLite wamp 交通频道