Use the w command and uptime command in Linux to view the system load
In Linux, when querying the CPU and memory loads (usage), we are usually used to using top, atop, or ps, this article will introduce how to use the w command and uptime command to view the system load. I believe you are familiar with the uptime command, it is mainly used to query how long it took to run after the last startup, while the w command is relatively unpopular. The following describes how to use these two commands:
1. w command
[root@bkjia ~]# w14:44:27 up 62 days, 3 min, 2 users, load average: 0.00, 0.01, 0.00USER TTY FROM LOGIN@ IDLE JCPU PCPU WHATroot pts/0 218.18.74.196 13:38 1:01m 0.00s 0.00s -bashroot pts/1 218.18.74.196 14:43 0.00s 0.00s 0.00s w
What is different from who is that Linux that uses man w to query the command is "Show who is logged on and what they are doing. ", w command can query the user information logged on to the current system, and what operations these users are currently doing, this information is of value to the Linux system administrator, in addition, the three numbers after the load average show the average load of the system in the last 1 minute, 5 minutes, and 15 minutes.
2. uptime command
[root@bkjia ~]# uptime14:51:15 up 62 days, 10 min, 2 users, load average: 0.02, 0.01, 0.00
The load average in the uptime command ECHO is similar to the w command, indicating the average number of processes in the process queue in the past 1 minute, 5 minutes, and 15 minutes.
Note that the output value of load average is generally not larger than the number of logical CPUs of the system. For example, the system has four logical CPUs in the current output, if the three load average values are greater than 4 for a long time, the CPU is busy and the load is high, which may affect the system performance, generally, the system performance is not affected. On the contrary, if the output value of load average is smaller than the number of CPUs, it indicates that the CPU is still idle. For example, the output in this example, the CPU is relatively idle.
This article permanently updates the link address: