Query system CPU and memory load (usage) in the Linux system, we usually accustomed to using top, atop or ps, this article will give you about how to use the w command and uptime command to view the system load, for uptime command, I believe we are more familiar with, it is mainly used to query the system up and running after the last how long, and w commands are relative to some of the unpopular, the following detailed description of how to use these two commands:
1. w command
[Root @ abctest ~] # w
14:44:27 up 62 days, 3 min, 2 users, load average: 0.00, 0.01, 0.00
USER TTY FROM LOGIN @ IDLE JCPU PCPU WHAT
root pts / 0 18.104.22.168 13:38 1: 01m 0.00s 0.00s -bash
root pts / 1 22.214.171.124 14:43 0.00s 0.00s 0.00s w
And who is different is that the use of the Linux man w query command presentation is "Show who is logged on and what they are doing.", W command queries the current system login user information, and these users are currently doing operation, the information for Linux system administrators are worth, and the other three digits the load average which shows the back of the system last 1 minute, 5 minutes, the system average load for 15 minutes.
2. uptime command
[Root @ abctest ~] # uptime
14:51:15 up 62 days, 10 min, 2 users, load average: 0.02, 0.01, 0.00
uptime command back to the meaning and w commands the load average was expressed similar, are represented in the past 1 minute, the average number of 5 minutes and 15 minutes in the process queue process.
It should be noted that the output value of the load average, the size of these three values are generally not be greater than the number of logical CPU system, for example, the output of the system has four logical CPU, if the load average value of three long-term greater than 4:00 described CPU is very busy, very high load, it can affect system performance, but occasionally more than 4, down do not worry, generally will not affect system performance. Conversely, if the output load average value is less than the number of CPU, the CPU is idle as well, such as this example output, CPU is relatively idle.