CPU Load and CPU Utilization Both of these can reflect the busyness of a machine to a certain extent. The CPU usage rate reflects the current CPU busyness. The reason for the fluctuation is that the process that occupies the CPU processing time may be in the IO wait state but has not yet been released to wait. The load average refers to the number of processes that occupy CPU time and wait for CPU time within a certain period of time. Here, the process waiting for CPU time refers to the process waiting to be awakened, excluding the process in the wait state. From the above analysis, we can see that a machine is very likely to be in a situation of low CPU usage and high load. Therefore, the busyness of the machine should be viewed in combination with both. From the actual usage observation, my own dual-core Xeon 2.8GHZ, 2G memory machine has an average load of about 50, and the CPU usage is close to 100% (the application has a lot of IO operations). In this case, the application is still smooth and the actual access delay is not very high. Therefore, when the CPU is still idle, how to improve IO response is the key to reducing the load. Many people think that the machine is very busy when the load reaches dozens. I think that if the CPU utilization rate is relatively low at this time, the high load may not explain the problem well. Once the process processed by the CPU is completed, those waiting processes can also get a response immediately. In this case, the IO read and write speed should be optimized. If the CPU usage rate is always above 90%, even if the average load is only in the single digit (for example, a certain process is always running), the machine is actually busy. In fact, in the previous article, it was also written that the CPU usage is low and the load is high. The reason for the low CPU usage, but the load is very high, the high load may be IO An Analogy for CPU Load To determine whether the system is overloaded, you must understand the true meaning of load average. Below, I will try to explain this problem in the most popular language based on the article "Understanding Linux CPU Load". The system load is 0.5, which means that half of the bridge has cars on it. A system load of 1.0 means that there are cars on all sections of the bridge, which means that the bridge is "full". But it must be noted that the bridge was still accessible until this time. The system load is 1.7, which means that there are too many vehicles and the bridge is already fully occupied (100%), and the vehicles waiting to board the bridge account for 70% of the vehicles on the bridge. By analogy, a system load of 2.0 means that the number of vehicles waiting to board the bridge is the same as the number of vehicles on the bridge deck; a system load of 3.0 means that the number of vehicles waiting to board the bridge is twice the number of vehicles on the bridge deck. In short, when the system load is greater than 1, the vehicles behind must wait; the greater the system load, the longer they must wait to cross the bridge. The system load of the CPU is basically equivalent to the analogy above. The traffic capacity of the bridge is the maximum workload of the CPU; the vehicles on the bridge are processes waiting to be processed by the CPU. CPU Load - Multiprocessor Above, we assumed that your computer has only 1 CPU. What would happen if your computer had 2 CPUs installed? Therefore, 2 CPUs indicate that the system load can reach 2.0, at which point each CPU reaches 100% of its workload. Generally speaking, for a computer with n CPUs, the maximum acceptable system load is n.0. CPU Load - Multi-core Processors Chip manufacturers often include multiple CPU cores within a single CPU, which is called a multi-core CPU. Rules of thumb for system loading Is 1.0 the ideal value for system load? Not necessarily. System administrators often leave some wiggle room. When this value reaches 0.7, you should pay attention. The rule of thumb is this:
My machine has 24 cores, so what is the appropriate load?
The answer is:
Optimal observation time The last question is, "load average" returns three average values ---- 1 minute system load, 5 minutes system load, 15 minutes system load, ---- which value should I refer to? If the system load is greater than 1.0 for only 1 minute and less than 1.0 for the other two time periods, this indicates that it is only a temporary phenomenon and is not a serious problem. If the average system load is greater than 1.0 (after adjusting the number of CPU cores) within 15 minutes, it indicates that the problem persists and is not a temporary phenomenon. Therefore, you should mainly observe the "15-minute system load" and use it as an indicator of the normal operation of the computer. You may also be interested in:
|
<<: How to Develop a Progressive Web App (PWA)
>>: Detailed explanation of the execution plan explain command example in MySQL
Table of contents 1. What I am going to talk abou...
Overview Let's summarize some SQL statements ...
Regarding uninstalling the previously installed v...
Table of contents A murder caused by ERR 1067 The...
Install MySQL database a) Download the MySQL sour...
Table of contents How to represent the current ti...
1. Basic knowledge: Http Header User-Agent User A...
HTML provides five space entities with different ...
Background: Linux server file upload and download...
Two methods to implement Mysql remote connection ...
1. Command Introduction The file command is used ...
Download image docker pull openjdk Creating a Dat...
1. Virtual environment follows the project, creat...
Disadvantages of single-node database Large-scale...
Table of contents Add traffic function to github+...