您的位置:首页 > 运维架构 > Linux

Linux load average平均负载

2013-09-10 16:38 162 查看
查看load average平均负载, 在uptime, w及top均可显示,

sled11:/proc> w

 16:22:11 up  1:42,  3 users,  load average: 0.19, 0.35, 0.22
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
zmao     :0        14:40   ?xdm?  25:55   0.15s /usr/lib/gdm/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1
zmao     pts/0     14:41    0.00s  0.39s  0.01s w
zmao     pts/2     14:42    9:58   0.43s  0.01s man 5 proc

sled11:/proc> uptime

  4:22pm  up   1:42,  3 个用户,平均负载:0.18, 0.35, 0.22

sled11:/proc> cat /proc/loadavg

0.16 0.34 0.21 1/348 11858

在man 5 proc中有/porc/loadavg中对应域的意义:

 /proc/loadavg

              The first three fields in this file are load average figures givingthe number of jobs in the run queue (state R) or waiting for disk I/O (state  D)  averaged

              over  1,  5,  and  15 minutes.  They are the same as the load average numbers given by uptime(1) and other programs.  The fourth field consists of two numbers

              separated by a slash (/).  The first of these is the number of currently executing kernel scheduling entities (processes, threads); this will be less than  or

              equal  to  the  number of CPUs.  The value after the slash is the number of kernel scheduling entities that currently exist on the system.  The fifth field is

              the PID of the process that was most recently created on the system.

理解负载的高低标准,请参考:
http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages
(中文)http://os.51cto.com/art/200911/164410.htm

简单来说就是,对应于单CPU系统,负荷 1.00表明系统已经没有剩余的资源了,有经验管理员认为 0.70是上限。对于多CPU系统(包括多核),则可将对应的负荷除CPU数来理解,比如2核或2CPU系统,则负荷 2.00才表明系统已经没有剩余的资源。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  平均工作负载