sys_getloadavg 获取系统的负载(load average)
发表日期:2021-07-01 10:15:43 | 来源: | | 浏览(591) 分类:杂项 函数
sys_getloadavg
(PHP 5 >= 5.1.3, PHP 7, PHP 8)
sys_getloadavg — 获取系统的负载(load average)
说明
sys_getloadavg(): array
返回三个系统负载(系统运行队列中的进程数)的样本数据,分别是1分钟、5分钟和15分钟之前。
返回值
返回一个包含1分钟、5分钟和15分钟之前采样数据的array。
范例
示例 #1 sys_getloadavg() 的例子
<?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 平台下实现。
- PHP(0)
- PHP杂项(34)
- PHP基础-李炎恢系列课程(20)
- 中文函数手册(0)
- 错误处理 函数(13)
- OPcache 函数(6)
- PHP 选项/信息 函数(54)
- Zip 函数(10)
- Hash 函数(15)
- OpenSSL 函数(63)
- Date/Time 函数(51)
- 目录函数(9)
- Fileinfo 函数(6)
- iconv 函数(11)
- 文件系统函数(81)
- 多字节字符串 函数(57)
- GD 和图像处理 函数(114)
- 可交换图像信息(5)
- Math 函数(50)
- 程序执行函数(11)
- PCNTL 函数(23)
- JSON 函数(4)
- SPL 函数(15)
- URL 函数(10)
- cURL 函数(32)
- 网络 函数(33)
- FTP 函数(36)
- Session 函数(23)
- PCRE 函数(11)
- PCRE 正则语法(19)
- 数组 函数(81)
- 类/对象 函数(18)
- 函数处理 函数(13)
- 变量处理 函数(37)
- SimpleXML 函数(3)
- 杂项 函数(31)
- connection_aborted 检查客户端是否已经断开(0)
- connection_status 返回连接的状态位(0)
- constant 返回一个常量的值(0)
- define 定义一个常量(0)
- defined 检查某个名称的常量是否存在(0)
- die 等同于 exit()(0)
- eval 把字符串作为PHP代码执行(0)
- exit 输出一个消息并且退出当前脚本(0)
- get_browser 获取浏览器具有的功能(0)
- __halt_compiler 中断编译器的执行(0)
- highlight_file 语法高亮一个文件(0)
- highlight_string 字符串的语法高亮(0)
- hrtime 获取系统的高精度时间(0)
- ignore_user_abort 设置客户端断开连接时是否中断脚本的执行(0)
- pack 将数据打包成二进制字符串(0)
- php_strip_whitespace 返回删除注释和空格后的PHP源码(0)
- sapi_windows_cp_conv Convert string from one codepage to another(0)
- sapi_windows_cp_get Get current codepage(0)
- sapi_windows_cp_is_utf8 Indicates whether the codepage is UTF-8 compatible(0)
- sapi_windows_cp_set Set process codepage(0)
- sapi_windows_generate_ctrl_event Send a CTRL event to another process(0)
- sapi_windows_set_ctrl_handler Set or remove a CTRL event handler(0)
- sapi_windows_vt100_support Get or set VT100 support for the specified stream associated to an output buffer of a Windows console.(0)
- show_source 别名 highlight_file()(0)
- sleep 延缓执行(0)
- sys_getloadavg 获取系统的负载(load average)(0)
- time_nanosleep 延缓执行若干秒和纳秒(0)
- time_sleep_until 使脚本睡眠到指定的时间为止。(0)
- uniqid 生成一个唯一ID(0)
- unpack Unpack data from binary string(0)
- usleep 以指定的微秒数延迟执行(0)
- 字符串 函数(101)