About the CPU's running queue and system load

Source: Internet
Author: User

In the Linux operating system, we generally look at the CPU load of the system commonly used commands can be uptime,top, as well as vmstat and so on are all possible. The information provided by each tool is different,

I'm going to talk about the CPU section here. Using the uptime command, you can get the operating system in the last 1 minutes, 5 minutes and 15 minutes of the CPU average load value, that is, the legendary load average, this and the top command in the upper right corner of the display of the east is figured out, then this load Average exactly what kind of thing, in fact, it represents the number of processes running in the CPU, but the process here and the use of commands to see the process can not be the same. The number of processes that the CPU can handle and host in a certain amount of time is limited, and this number is directly related to the performance of the CPU, or this value marks the performance of the CPU, which is reflected in the actual use of the computer to be higher performance CPU can process more process content at the same time, so say, Generally when you go to computer city to buy a personal computer when the shopping guide will ask you about the general use of computers, in fact, they are to help you calculate the computer performance you need, including the calculation of the maximum load on the CPU, of course, they will not be so to calculate, but according to the price, because the high-priced CPU often better performance, Then, they will ask you about the budget, in fact, when you know that you buy the use of computers after their own heart has helped you budget, if your budget is higher than their budget, then congratulations to the computer, he can earn more. Therefore, to buy a computer must be based on actual needs, such as CPU support is very high load, and you in the actual use is not up to that high load, that does not become a kill chicken with a pig knife.

The

pulls away, after all, the higher the number of processes the CPU can handle in a unit of time, the higher its performance should be. But about this load, there are many kinds of information on the Internet, some say that the load should not exceed the core of the CPU, some say should not exceed the CPU core number of twice times, some say should not exceed the CPU core number of 3 times times, why there are so many statements, in fact, we are worried about a phase The same problem----afraid of CPU can't carry, here super not more than several times does not matter, the most important criterion is that your CPU in a certain degree of load is not the system and applications are still running well, that is, the standard of judgment is also related to the actual application, If the CPU load is over the core number several times but the software is still running smoothly, that is also possible. Here to talk about the CPU running queue, the status parameters about the running queue can be viewed through the vmstat command, there is not much to explain, it has two, one is run, one is blocked, that is, Vmstat to see the first two rows, run represents the CPU inside the execution, Blocked representative because of disk or other bottlenecks caused him to wait in the CPU, these two values and the use of uptime or top command to see the system load value is very related, basically, the system at a certain time the load value is equivalent to the value of run plus the value of blocked, However, it is not right to use addition to express this, the system load value is an average, can be a decimal, and the number of running queues is an integer. In the case of idle CPU, run+blocked generally close to 0, occasionally jumping out of a 1 Ah 2 ah, so the load average idle state is generally 0.

However, when the load of the system gradually increased, that is, the CPU is running more and more things, then the reaction to the load mean its value will gradually increase, and can be very large, completely outside the CPU core number of many times, For example, I used a 8-core machine in the previous days to test the top command to see the load value reached nearly 600, which is far beyond the CPU can withstand the range, then why has exceeded the acceptable range of this load mean can also rise to that high, this is because in the CPU, The number of processes that can run at the same time is limited, that is, vmstat see the maximum number of run values, but blocked can continue to grow, because the process has been blocked off, it almost takes up a lot of CPU resources, and the run is not the same, A CPU at the same time can run how much depends on its physical performance, so when your machine load is constantly rising, you use the top command to see the load value will continue to rise, and when the load reaches a certain height, the CPU can handle the queue also reached the upper limit, the value of run no longer increases, at this time, The value of the blocked continues to increase, and in theory, the blocked can be increased until the system crashes.

Summary: In the evaluation of the performance of the CPU is completely copied online said several times is not accurate, but also you have to see the vmstat display of the run value and blocked value, when there are significantly more blocked, it shows that the CPU has produced a bottleneck. The load mean displayed by the top command and the uptime command can only be used as a reference for judging the state of the system in the past time period, which is not related to the performance of the CPU.

About the CPU's running queue and system load

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.