System load load

A check system load

If your computer is slow, you might want to look at, whether it's work too.

In the Linux system, we generally use the uptime command to view (w command and also the top command line). (In addition, they are also applicable on Apple's Mac computers.)

Uptime you type in a terminal window, the system returns a row of information.

This latter part of the line information showing "load average", which means "the average load of the system," there are three numbers, which we can determine the system load is large or small.

Why are there three figures? You found the manual, meaning they are 1 minute, 5 minutes, the average load of the system within 15 minutes.

If you continue to look at the manual, it will tell you exactly when the CPU is idle, the average load is zero; when the CPU workload saturated, with an average load of 1.

Clearly then, the value of "load average" is lower, for example equal to 0.2 or 0.3, it means that the smaller the computer workload, the system load is relatively lighter.

However, when the system load is heavy you can see it? When equal to 1 or equal to 0.5 times or equal to 1.5? If 1 minute, 5 minutes, 15 minutes three values ​​are not the same, how do?

Second, an analogy

The system determines whether the load is too heavy to be understood that the true meaning of the load average. Now, according to my " Understanding the Load Linux the CPU " article, try to use the most popular language to explain the problem.

First, assuming the simplest case, your computer has only one CPU, all operations must be done by the CPU.

Well, we might as well put this CPU imagine a bridge, the bridge has only one lane, all vehicles must be from the roots through the lane. (Obviously, this bridge can only be one-way.)

System load is zero, the car does not mean that the bridge.

System load of 0.5, means that half of the road bridge and a car.

System load of 1.0, means that all sections of the bridge has a car, which means that the bridge had been "filled" the. It must be noted that, until now still be able to smooth the passage of the bridge.

System load of 1.7, meaning that the vehicle too much, the bridge has been filled up (100%), followed by waiting vehicles on the bridge deck of the vehicle is 70%. So, the system load is 2.0, meaning that the vehicle waits for the vehicle on the deck of the bridge as much; 3.0 system load means that the vehicle is waiting on the bridge deck vehicle twice. In summary, when the system load is greater than 1, the back of the vehicle must wait; the higher the system load, the longer the like must bridge.

The system CPU load, substantially identical to the above analogy. Capacity of the bridge, is the biggest workload of the CPU; vehicles on the bridge, is a wait CPU processing process (process).

If the CPU processing process up to 100 per minute, the system load of 0.2, means that the CPU in this one only 20 minutes treatment processes; system load 1.0, means that the CPU 100 processes just deal with this one in minutes; the system load 1.7 , it means that in addition to the 100 CPU is processing process, as well as 70 process is waiting in the CPU.

For computers running smoothly, the system load should not exceed 1.0, and so there is no need to wait for the process, the first time all processes can be dealt with. Obviously, 1.0 is a critical value, above this value, the system is not in the best condition, you want a hands-on intervention.

Third, the rule of thumb system load

1.0 is an ideal value system load it?

Not necessarily, system administrators often leave little room, when the value reaches 0.7, should attract attention. The rule of thumb is this:

When the system load duration greater than 0.7, you must begin to investigate, and where the problem is to prevent the situation worsening.

When the system load duration greater than 1.0, you have hands-on search for solutions, this value down.

When the system load reaches 5.0, it means that your system has a very serious problem for a long time did not respond, or nearly crashed. You should not allow the system to reach this value.

Fourth, multi-processor

Above, we assume that your computer has only one CPU. If your computer is installed 2 CPU, what would happen?

2 CPU, means the computer's processing power has doubled, the number of processes can be processed simultaneously also doubled.

Or by analogy to the bridge, two CPU means that the bridge has two lanes, the traffic capacity doubled.

Therefore, CPU 2 indicates that the system load can reach 2.0, when each CPU reaches 100% of the workload. Popularized, n-PC-CPU, acceptable system maximum load n.0.

Fifth, multi-core processors

Chip vendors often an internal CPU, comprising a plurality of CPU cores, which is called a multi-core CPU.

In terms of system load, similar to the multi-core CPU and multi-CPU effect, so consider the system load, you must consider this computer has several CPU, each CPU has several core. Then, the system load divided by the total number of cores, each core as long as the load is not more than 1.0, it indicates the normal operation of the computer.

How to know how many computer CPU core of it?

"Cat / proc / cpuinfo" command to view CPU information. "Grep -c 'model name' / proc / cpuinfo" command, direct return of the total number of CPU cores.

Sixth, the best long observation

One last question, "load average" total return average of three ---- 1 minute system load, system load 5 minutes, 15 minutes system load, which ---- should reference value?

If the system load is only 1 minute more than 1.0, the other two time periods is less than 1.0, indicating only a temporary phenomenon, not a big problem.

(After adjusting the number of CPU cores) within 15 minutes if the average system load is greater than 1.0, indicating that the problem persists, not a temporary phenomenon. So, you should observe the main "15 minutes system load", it will be as an indicator of normal operation of the computer.

Guess you like

Origin www.cnblogs.com/igoodful/p/11785000.html