Linux command - uptime to view system operating load

Uptime-View the system running load situation
example:
1. Uptime
current time current user load 1 minute 5 minutes 15 minutes
16:03:20 up 28 days, 2 min, 1 user, load average: 0.00, 0.04, 0.05

压测工具:stress
平均负载: mpstat pidstat

How to understand load average: Load average refers to the average number of processes in a runnable and uninterruptible state per unit time, that is, the average number of active processes. PS: The average load is not directly related to the CPU usage.

划重点,因此你可以简单理解为,平均负载其实就是单位时间内的活跃进程数。

那么在实际生产环境中,平均负载多高时, 65%-70%

Scenario 1: CPU-intensive process
[root@www ~]# stress --cpu 4 --timeout 600

[root@www ~]# watch -d uptime
[root@www ~]# mpstat -P ALL 5
[root@www ~]# pidstat -u 5 1

Scenario 2: I/O intensive process
[root@m01 ~]# stress --io 1 --timeout 600s

Scenario 3: A large number of processes
[root@m01 ~]# stress -c 4 --timeout 600

The average load provides a quick way to view the overall performance of the system and reflects the overall load situation.
But just by looking at the load average itself, we can't directly find out where the bottleneck is.

Therefore, when understanding the average load, you should also pay attention:
high average load may be caused by CPU-intensive processes;
high average load does not necessarily mean high CPU usage, and it may be that I/O is busy;
when the load is found When it is high, you can use mpstat, pidstat and other tools to assist in analyzing the source of the load

Guess you like

Origin blog.51cto.com/paitoubing/2544469