Linux Learning CPU Load Rate calculation method understanding

Source: Internet
Author: User

The concept of Load average originates from UNIX systems, and although the formulas vary from one family to the other, they are used to measure the number of processes that are using the CPU and are waiting for the CPU, in a word, the number of runable processes. So load average can be used as a reference for CPU bottlenecks, and if it is larger than the number of CPUs, the CPU may not be enough.

But there's a bit of a difference on Linux!

The load average on Linux includes the number of processes that uninterruptible sleep, in addition to the number of processes that are using the CPU and the number of processes that are waiting for the CPU. The process is usually in uninterruptible sleep state while waiting for the IO device and waiting for the network. The logic of the Linux designer is that uninterruptible sleep should be ephemeral and will soon resume running, so it is equivalent to runnable. However, uninterruptible sleep even if it is also a short sleep, not to mention the real world uninterruptible sleep may not be very short, a lot of, or a long time uninterruptible Sleep usually means that the IO device is experiencing a bottleneck. As we all know, the process of sleep state does not need the CPU, even if all the CPU is idle, the process of sleep is not running, so the number of sleep process is definitely not suitable for measuring CPU load, Linux put uninterruptible The sleep process's calculation of load average directly overturns the original meaning of load average. So on the Linux system, the load average this indicator basically loses the function, because you do not know what it means, when see load average high, you do not know is runnable process too much or uninterruptible Sleep process too much, you can not determine whether the CPU is not enough or the IO device has a bottleneck.

On the other side, it can also explain why the CPU load is high when the disk is slow (when a large amount of disk is used). Basically, I have a high CPU load situation in two cases: the CPU itself to handle too many tasks, coupled with soft interrupts and context switching too often lead to high load, and then the disk is too slow to cause too much non-disruptive sleep caused high CPU load.

Hope that through the sharing can help the needs of the pot friends. Linux is now popular with internet companies and wants to stand out from the many IT workers, requiring advanced technology and learning to add value is essential. The way of learning is your insistence. Old boy Education Linux cloud Computing Operations course, 10 years of technical precipitation, put an end to paper, the whole enterprise real case combined with theoretical teaching, want to learn more about the Linux cloud computing operations knowledge, can pay attention to the old boy education.


Linux Learning CPU Load Rate calculation method understanding

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.