1. Memory Analysis Method
The memory analysis method is mainly used to determine whether the system has encountered a memory bottleneck and whether to improve the system performance by adding memory or other means. The main counters include memory and physical disk counters.
The main steps and methods of memory analysis are as follows:
(1) first view the memory \ available Mbytes metrics
This value is a direct indicator used to describe the available memory of the system. When analyzing the system memory at the operating system level, we should first use this value to create a preliminary impression, check whether the system still has enough memory available during performance system testing.
If the metric data is small, the system may encounter memory problems. Further analysis is required.
(2) Pay attention to the pages/sec, pages read/sec, and page faults/sec values.
The operating system often uses the disk swap method to increase the available memory volume of the system or increase the memory usage.
Efficiency. These three indicators directly reflect the disk swap frequency of the operating system.
If the Count of pages/sec continues to exceed several hundred, there may be memory problems. However, a large value may not necessarily indicate memory problems, this may be caused by running the program that uses the memory ing file.
Page faults/sec indicates the number of page failures per second. The more page failures occur, the more times the Operating System reads to the memory.
In this case, you also need to check the pages read/sec counter. The threshold value of this counter is 5. If it exceeds 5, you can determine that there is a memory problem.
(3) analyze performance bottlenecks based on physical disk counter values
The analysis of physical disk counters includes pages read/sec, % disk Time, and average.
Disk queue length analysis.
If pages read/sec is low, % disk Time and average disk queue length at the same time
A high value may cause a disk bottleneck.
However, if the length of the average disk queue increases while pages read/sec does not decrease, it is caused by insufficient memory.
(Note: Counter indicators used in memory analysis methods include:
Memory \ available Mbytes
Memory \ pages/sec, pages read/sec, and page faults/sec
Physical disk % disk time, average disk Queue Length
)
2. processor Analysis Method
The CPU may also be the bottleneck of the system. The process for analyzing the performance of the processor is as follows:
(1) first check the Count value of the system % Total processor time performance counter
This value is used to reflect the overall processor utilization of the server. For a multi-processor system, this value reflects the average utilization of all CPUs.
If the value continues to exceed 90%, it indicates that the entire system is facing a bottleneck in this processor. You need to increase the processor to improve performance.
Note:
Due to the characteristics of the operating system, in some multi-CPU Systems, the data itself is not large, but at this time the CPU
The load between them is extremely unbalanced. At this time, it should also be considered as a bottleneck in the processing system.
(2) Check the processor % processor time and processor % USER time and processor % privileged time of each CPU.
Processor % USER time refers to the CPU time consumed by the system's non-core operations. If this value is large, you can consider whether to reduce this value through algorithm optimization or other methods.
If the server is a database server, the reason for the large processor % USER time value is probably that database sorting or function operations consume too much CPU time. In this case, you can consider optimizing the database system.
(3) Study System Processor Bottlenecks
View the value of the system \ processor queue length counter. If the value is greater than the total number of CPUs + 1, the processor is blocked. When the processor's % processor time is constant, the processor is usually blocked. However, when the processor % processor time counter is blocked, the value of the processor % processor time counter is not necessarily large, in this case, you need to find out why the processor is blocked.
% DPC time is another item that requires attention. The lower the value, the better. In a multi-system processor, if the value is greater than 50% and processor % processor time is very high, adding a network adapter may improve the performance.
(Note: The main counter indicators used by the processor analysis method include:
System % Total processor time
Processor % processor time, % USER time, % privileged time, % DPC time
System \ processor Queue Length
)
3. Disk I/O Analysis Method
By analyzing the memory values of physical disks and memory counters, we can know that disk I/O is also a key factor affecting system performance. If the analyzed counter indicators come from database servers, file servers, or streaming media servers, disk I/O becomes a bottleneck for the system.
The following describes how to analyze disk I/O:
(1) Calculate the I/O count per Disk
The I/O quantity of each disk can be compared with the I/O Capacity of the disk. If the calculated I/O quantity of each disk exceeds the nominal I/O Capacity of the disk, it indicates that the disk performance bottleneck exists.
The following table shows the calculation formula for each disk I/O:
| RaidType |
Calculation Method |
| Raid0 |
(READS + writes)/number of disks |
| Raid1 |
(READS + 2 * writes)/2 |
| RAID5 |
[Reads + (4 * writes)]/number of disks |
| Raid10 |
[Reads + (2 * writes)]/number of disks |
(2) Merge with processor \ privileged time for analysis
If only % disk Time is relatively large in the physical disk counter and other values are relatively moderate, the hard disk may be a bottleneck.
If several values are relatively large and the value continues to exceed 80%, memory leakage may occur.
(3) Analysis Based on disk transfer/sec
Generally, it is best to define a value smaller than 15 ms, which is good between 15-30 ms and acceptable between 30-60 ms. If the value exceeds 60 ms, you need to consider replacing the hard disk or hard disk raid mode.
(Note: The counters used for disk I/O analysis are:
Processor \ privileged time
Physical disk % disk Time, disk transfer/sec
)
4. Process Analysis Method
(1) view the % processor time value of the process
The % processor time of each process indicates the processor time consumed by the process. Compare the processor time consumed by different processes. It is easy to see which process consumes the most processor time in the performance test process, so that the application can be optimized accordingly.
(2) check that the page generated by each process is invalid.
The ratio of page invalidation generated by each process (obtained through the process \ page failures/sec counter) to page invalidation of the system (obtained through the memory \ page failures/sec counter, to determine which process generates the most invalid pages. This process either requires a large amount of memory or is very active and can be analyzed in progress.
(3) understand the process \ private bytes
Process \ private bytes refers to the number of bytes allocated by the process that cannot be shared with other processes. This counter mainly uses pulling to determine whether the process has memory leakage during the performance test.
For example, for a Web application on IIS, we can focus on monitoring the private bytes of the Inetinfo process. If the private bytes counter value of the process increases during the performance test, or after the performance test is stopped for a period of time, the private bytes of the process continues at a high level, which indicates that the application has memory leakage.
(Note: The counters used in the Process Analysis method mainly include:
Process % processor time, page failures/sec, page failures/sec, private bytes
)
5. Network Analysis Methods
Network Analysis is a highly technical task. In general organizations, there are dedicated network administrators for network analysis. For testing engineers, if they suspect that the network is a bottleneck of the system, you can require that the network still have photos for network detection.
Network Interface \ bytes total/sec is the speed at which bytes are sent and received (including frame characters ). You can use the counter value to determine whether the network connection speed is a bottleneck. The specific operation is to use the counter value to compare with the current network bandwidth.
Performance Analysis Method