Linux cpu load learning notes and load learning notes
Measure the current CPU workload by Load in linux
Load Average is the Average Load within a period of time (1 minute, 5 minutes, 15 minutes.
[root@CNC-BJ-5-3N1 ~]# w20:01:55 up 76 days, 8:20, 6 users, load average: 1.30, 1.48, 1.69
Meaning of the load average Value
Assume that our system is single-CPU, single-core, which is a one-way road, and the CPU task is compared to a car. When there are not many cars, load <1; when the car occupies the whole road, load = 1; when the road is full and the road is full of cars, load> 1
We often find that the server Load> 1 is still running well because the server is a Multi-core processor ). If our server CPU is 2 cores, it means we have 2 roads. When we Load = 2, all roads are full of vehicles.
View the number of CPU Cores
# View CPU core grep 'model name'/proc/cpuinfo | wc-l # CPU information:/proc/cpuinfo # memory information:/proc/meminfo
Be cautious about the Load average Value
- 0.7 <load <1: This is a good situation. If you come in with more cars, you can still cope with the road.
- Load = 1: Your road is about to be congested, and there are no additional tasks for more resources. Check out what happened.
- Load> 5: very congested. Our road is very busy and every car cannot run very quickly.
Which of the following are the three Load values?
Generally, let's take a look at the 15-minute load. If the load is high, let's take a look at the load for 1 minute and 5 minutes to see if there is a downward trend. If the 1-minute load value is greater than 1, we don't have to worry about it, but if the load exceeds 1 in 15 minutes, we need to hurry and see what happened. Therefore, we need to view the three values based on the actual situation.