![ubuntu cpu负载](https://i-blog.csdnimg.cn/blog_migrate/6728046dca8621bde35707a1f3acd307.png)
ubuntu cpu负载
Ubuntu linux has a rich set of commands for getting system info. One of the useful pieces of information that a system administrator might need is to know what the overall system load on a server is.
Ubuntu linux有很多用于获取系统信息的命令。 系统管理员可能需要的有用信息之一是,了解服务器上整个系统的负载是多少。
There are a couple of ways to get this information, which may or may not be enabled on your system. It’s useful to know more than one way to get the uptime information in case the commands are disabled on your shared hosting server.
有两种获取此信息的方法,您的系统可能启用或未启用。 如果在共享托管服务器上禁用了命令,则了解不止一种获取正常运行时间信息的方法很有用。
uptime
正常运行时间
The uptime command gives information on system load averages for the past 1, 5, and 15 minutes:
uptime命令提供有关过去1分钟,5分钟和15分钟的系统平均负载的信息:
Example:
例:
[root@ubuntu geek]# uptime05:59:07 up 87 days, 13:13, 1 user, load average: 0.00, 0.00, 0.39
[root @ ubuntu geek]#uptime05:59:07 up 87 days,13:13,1 user,平均负载:0.00,0.00,0.39
w
w
The w command shows who is logged on and what they are doing, including system load averages for the past 1, 5, and 15 minutes.
w命令显示谁已登录以及他们正在做什么,包括过去1、5和15分钟的平均系统负载。
[root@ubuntu geek]# uptime05:59:56 up 87 days, 13:13, 1 user, load average: 0.00, 0.00, 0.39USER TTY FROM LOGIN@ IDLE JCPU PCPU WHATgeek pts/0 192.168.1.115 6:31pm 0.00s 0.62s 0.03s /usr/sbin/sshd
[root @ ubuntu geek]#正常运行时间05:59:56最多87天,13:13、1个用户,平均负载:0.00、0.00、0.39来自登录用户的TTY @ IDLE JCPU PCPU WHATgeek pts / 0 192.168.1.115 6:31 pm 0.00秒0.62秒0.03秒/ usr / sbin / sshd
/proc/loadavg
/ proc / loadavg
The /proc/loadavg file contains information on the system load. Most likely the uptime/w commands utilize this information. The first 3 values contain system load averages for the past 1, 5, and 15 minutes.
/ proc / loadavg文件包含有关系统负载的信息。 uptime / w命令最有可能利用此信息。 前三个值包含过去1、5和15分钟的系统平均负载。
[root@ubuntu geek]# cat /proc/loadavg0.00 0.00 0.39 1/49 15352
[root @ ubuntu geek]#cat /proc/loadavg0.00 0.00 0.39 1/49 15352
There are probably some more commands, but these are the ones off the top of my head that I know of.
可能还有更多的命令,但是这些是我所不知道的。
翻译自: https://www.howtogeek.com/howto/ubuntu/get-cpu-system-load-average-on-ubuntu-linux/
ubuntu cpu负载