Quickly optimize common commands to improve Linux performance

1.uptime command

 System current time 10:52:08

up 14:56, the time the system has been up since the last boot

0 users, the number of current user logins

load average, the average system load within 1 minute, 5 minutes, and 15 minutes;

        The system load average is the average number of processes in a runnable or uninterruptible state. A process in the runnable state means that the process is using the CPU or waiting to use the CPU. A process in an uninterruptible state is one that is waiting for some I/O access, such as waiting for a disk. Averages are taken over three time intervals. The load average is not normalized to the number of CPUs in the system, so a load average of 1 means that a single CPU system is constantly loaded, whereas on a 4 CPU system it means it is idle 75% of the time.

        This command can quickly check the system load average, you can think of this load value as showing how many tasks are waiting to run. On Linux systems, this includes tasks that want or are using the CPU, as well as tasks that are blocked on io. This command can give us a general understanding of the global state of the system, but we still need to use other tools to get more information.

        These three values ​​are the exponentially weighted dynamic averages calculated by the system for 1 minute, 5 minutes, and 15 minutes, which can be simply considered as the average value in this time period. Based on these three values, we can understand how the system load changes over time. For example, suppose there is a problem with the system now, and you check the three values ​​and find that the load value of 1 minute is much smaller than the load value of 15 minutes, then you have probably missed the point in time when the system went wrong.

        The Netflix performance engineering team introduced some standard Linux command-line tools that we use to analyze and locate problems within the first 60 seconds of discovery. In these 60 seconds, you can use the following 10 command lines to understand the overall operation of the system and the resource usage of the currently running process.

The following 10 commands:

uptime dmesg | tail vmstat 1 mpstat -P ALL 1 pidstat 1 iostat -xz 1 free -m sar -n DEV 1 sar -n TCP,ETCP 1 top

For details, please refer to the reference link: How to optimize and improve Linux performance in 60 seconds? Only 2% of people know

Guess you like

Origin blog.csdn.net/woshisunyizhen/article/details/130401853