Linux system and performance monitoring

Source: Internet
Author: User
Article Title: Linux system and performance monitoring. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source. 1. Performance monitoring
Performance optimization is the process of identifying system bottlenecks and optimizing the operating system to eliminate these bottlenecks. Many System Administrators think that performance optimization can be simply solved by reading the cook book and setting some kernel parameters, but this is not the case. Performance Optimization balances the performance of subsystems. These subsystems include
CPU
Memory
I/O
Network
These subsystems are highly interdependent. The high load of any sub-system can easily lead to problems in other sub-systems. For example
A large number of page call-in I/O requests can block the memory queue
The full-load NIC will make the CPU busy
Maintaining the idle memory queue will make the CPU busy
A large amount of memory write requests to the hard disk will make the CPU and I/O channels busy
To optimize the system, you must find the bottleneck. Sometimes a subsystem seems to be faulty, but it may be caused by the overload of other subsystems.
1.1 determine the application type
In order to know where to start optimizing the bottleneck, the first point is to understand the characteristics of the system to be analyzed. Generally, system application stacks are divided into two types:
I/O constraints. I/O-constrained applications require a large amount of memory and other storage devices. The reason is that an I/O-constrained application processes a large amount of data (in memory), but does not need too many CPU and network resources (unless it is a storage device on the network ). I/O-constrained applications use the CPU to process I/O requests, and then generally enter sleep state. Database-type applications generally have I/O constraints.
CPU constraints. CPU-constrained applications require a large number of CPUs for batch processing or mathematical computing. Large-capacity website servers, email servers, and other types of servers are generally subject to CPU constraints.
1.2 determine the statistical benchmark
The system utilization efficiency depends on the Administrator's experience and system specifications. The only way to check whether the system has performance problems is to understand what the system should be optimized to, what performance should be achieved, and what a quantitative reference volume is. This requires a reference. This benchmark statistics should be tolerable to system performance, so that we can compare it with the subsequent performance.
The following example compares the system's reference statistical snapshot with the snapshot at high load.
# Vmstat 1
Procs memory swap io system cpu
R B swpd free buff cache si so bi bo in cs us sy wa id
1 0 138592 17932 126272 214244 0 0 1 18 109 19 2 1 96
0 0 138592 17932 126272 214244 0 0 0 105 46 0 1 0 99
0 0 138592 17932 126272 0 0 0 214244 62 40 14 0 45
0 0 138592 17932 126272 0 0 0 214244 49 0 0 117
0 0 138592 17924 126272 214244 0 0 176 220 3 4 13 80
0 0 138592 17924 126272 214244 0 0 0 358 8 17 0 75
1 0 138592 17924 126272 214244 0 0 0 368 4 24 0 72
0 0 138592 17924 126272 214244 0 0 0 352 9 12 0 79
# Vmstat 1
Procs memory swap io system cpu
R B swpd free buff cache si so bi bo in cs us sy wa id
2 0 145940 17752 118600 215592 0 1 1 18 109 19 2 1 96
2 0 145940 15856 118604 215652 0 0 468 789 86 14 0 0
3 0 146208 13884 118600 214640 0 360 360 71 91 9 0 0
2 0 146388 13764 118600 213788 0 340 340 41 87 13 0 0
2 0 147092 13788 118600 212452 0 740 1324 61 92 8 0 0
2 0 147360 13848 118600 211580 0 720 720 41 96 4 0 0
2 0 147912 13744 118192 210592 0 720 720 605 44 95 5 0 0
2 0 148452 13900 118192 209260 0 372 372 639 45 81 19 0 0
2 0 149132 13692 117824 208412 0 372 372 47 90 10 0 0
Compare the number in the last column, which represents the CPU idle time ratio. We can see that, in the baseline statistics, the CPU idle time accounts for 70%-90%. in the second output, the system runs times without being idle. Therefore, we can determine whether the CPU of the system is fully utilized.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.