Linux load View

Source: Internet
Author: User

Load is an important indicator of the Linux machine, which intuitively reflects the current state of the machine. If the machine load is too high, then the operation of the machine will be difficult.

Linux has a high load, mainly due to CPU use, memory usage, IO Consumption is composed of three parts. Any one use too much, will lead to a sharp rise in server load.

There are several commands to view server load, W or uptime can directly display the load,

$ uptime
12:20:30 up, 21:46, 2 users, Load average:8.99, 7.55, 5.40

$ w
12:22:02 up, 21:48, 2 users, Load average:3.96, 6.28, 5.16

The load average corresponds to the last 1 minutes, 5 minutes, and 15 minutes of the payload average.

These two commands simply reflect the load, and Linux provides a more powerful and useful top command to view the server load.

$ top

The top command can clearly show the state of the system, and it is real-time monitoring, press Q to exit.

The tasks line shows the total number of processes and the status of the current process, note that zombie, which represents a zombie process, does not have a 0 indication of a process problem.

The CPU (s) line shows the state of the current CPU, which means that the user process consumes CPU scale, SY indicates that the kernel process consumes CPU, the ID represents the percentage of idle CPU, and WA represents the percentage of CPU time that IO waits. WA occupies more than 30%, which means the IO pressure is very high.

The MEM line shows the current state of the memory, total is the overall memory size, userd is used, free is the rest, and buffers is the directory cache.

Swap lines with the Mem line, cached represents the cache, the user has opened the file. If the used of the swap is high, it indicates that the system is running out of memory.

Under the top command, press 1 to show how much CPU the server has and how each CPU is used

In general, the server's reasonable load is CPU core count. This means that for a 8-core CPU, the load within 16 indicates that the machine is running stably and smoothly. If the load exceeds 16, it indicates that the server is running with some pressure.

Under the top command, press SHIFT + "C" to sort the process according to CPU utilization from large to small, press shift+ "P", then sort the process by memory usage from large to small, it is easy to locate which services consume higher CPU and memory.

Just having the top command is not enough, because it only shows CPU and memory usage, and there is no clear display of--io for another important reason for the load to rise. Linux provides the Iostat command to understand the overhead of IO.

Enter the Iostat-x 1 10 command to start monitoring the input and output status,-X to display all parameter information, 1 to monitor every 1 seconds, 10 for total monitoring 10 times.

Where rsec/s is read, wsec/s represents write per second, the two parameters of a particularly high time to indicate that disk IO has a lot of pressure, util represents IO utilization, if close to 100%, indicating IO full load operation.

Summarize:

(1) Use the top command to view the load, under Top Press "1" to see the number of CPU cores, shift+ "C" by CPU utilization size, shif+ "P" according to the memory utilization of high and low ranking;

(2) Use the iostat-x command to monitor the IO input and output is too large

Linux load View

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.