[Misc][Unix][Command] iostat - Gukie/learning GitHub Wiki
refer
- https://en.wikipedia.org/wiki/Load_(computing)
- http://www.blogjava.net/sliverfancy/archive/2013/04/17/397947.html
- https://blog.csdn.net/igouwa/article/details/7194259(查看CPU和数)
在命令行中输入一下命令
uptime
23:43 up 3 days, 11:03, 3 users, load averages: 1.29 1.34 1.29
关于 load averages的解释就是: 一分钟内的平均负载,即如果单CPU的华,就是单个CPU的等待进程有几个,上面的华,就是有0.29个进程在等待 五分钟内的平均负载,即如果单CPU的华,就是单个CPU的等待进程有几个,上面的话,就是0.34个进程在等待 十五分钟内的平均负载,即如果单CPU的华,就是单个CPU的等待进程有几个,上面的话,就是0.29个进程在等待
原文
For example, one can interpret a load average of "1.73 0.60 7.98" on a single-CPU system as:
- during the last minute, the system was overloaded by 73% on average (1.73 runnable processes, so that 0.73 processes had to wait for a turn for a single CPU system on average).
- during the last 5 minutes, the CPU was idling 40% of the time on average.
- during the last 15 minutes, the system was overloaded 698% on average (7.98 runnable processes, so that 6.98 processes had to wait for a turn for a single CPU system on average).
This means that this system (CPU, disk, memory, etc.) could have handled all of the work scheduled for the last minute if it were 1.73 times as fast.
如何判断系统是否已经Over Load?
对一般的系统来说,根据cpu数量去判断。如果平均负载始终在1.2一下,而你有2颗cup的机器。 那么基本不会出现cpu不够用的情况。也就是Load平均要小于Cpu的数量
查看CPU和数
sysctl -machdep.cpu
sysctl -machdep.cpu.core_count