Difference between CPU utilization and Load Average?

Difference between CPU utilization and Load Average ?

CPU utilization is the statistics of CPU usage in a period of time . Through this indicator, we can see the situation of CPU occupancy in a certain period of time . If the CPU is occupied for a long time, it is necessary to consider whether the CPU is already in the Overload operation, long-term overload operation is a kind of damage to the machine itself, so the utilization rate of the CPU must be controlled under a certain ratio to ensure the normal operation of the machine.

Load Average is  the load of the CPU . The information it contains is not the utilization rate of the CPU , but the statistics of the sum of the number of processes that the CPU is processing and waiting for the CPU to process in a period of time , that is, the statistics of the length of the CPU usage queue. information.

So what is the difference between CPU utilization and Load Average for performance testing? In fact, the CPU utilization reflects the usage of the CPU. When the CPU is used for a long time without getting enough time to rest, it is an overloaded operation for the CPU hardware, and the usage frequency needs to be adjusted. The Load Average shows the description of the CPU usage status from another perspective. The higher the Load Average , the more intense the competition for CPU resources and the shortage of CPU resources. The application and maintenance of resources actually requires a lot of cost, so in the case of such a high Average Load , the long-term "hot competition" of CPU resources is also a kind of damage to the hardware.

How to evaluate a reasonable Load Average in performance requirements ?

Generally speaking, Load Average is related to the number of machine cores. Taking a single-core machine as an example, load=0.5 means that half of the CPU resources can handle other thread requests, load=1 means that all the resources of the CPU are processing requests, and there are no remaining resources to use, and load= 2 means that the CPU is overloaded, and there are twice as many threads waiting to be processed. Therefore, for a single-core machine, ideally, the Load Average should be less than 1 . Similarly, for dual-core processors, Load Average should be less than 2 . The conclusion is: In multi-core processors, your Load Average should not be higher than the total number of processor cores.

How to convert the load value between different core processors ?

You may encounter such a problem in the performance test. Your online machine has 8 cores, but the offline performance test machine only has 4 cores and 16 cores. Then the load value I got from the 16 -core machine test is 2.6 . How much should it be on an 8 -core machine?

Unfortunately, there is no exact formula that can be used to convert. But we can make an inference based on the meaning of load . If we test 100 threads concurrently accessing X pages on a dual-core machine and the load is 2 , then the same number of concurrent threads request the same page, on a single-core machine Test on the machine, what will the load be? On a dual-core machine, the load is 2 when 100 threads request at the same time , which means that both cores are operating at full load, and each core is processing 50 threads at the same time on average; if 100 threads request at the same time on a single-core machine , and assuming Each core can still process 50 threads at the same time, so there will be 50 threads waiting, so it seems that the load of the CPU is still 2 , but in fact, when 100 threads request the CPU at the same time, more than one CPU can process at the same time the ability of the threads, there will inevitably be competition between threads for the CPUHowever, the "hot competition" between threads and the CPU will cause the CPU to consume more resources for thread scheduling, so the overall effect is that the load value for a single core will actually be higher than 2 .

The above is my own inference, and I have not found the corresponding data verification on the Internet. If this inference is correct, the load tested on a 16 - core machine is 2.6 , and the load value tested on an 8 -core machine must be higher than 2.6 . How much higher should be related to the performance of the CPU itself, I don't know how to evaluate it. Interested students can come and discuss together!

 

http://pclfs1983.iteye.com/blog/654927

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327058050&siteId=291194637