Server Testing Technology details host Resource Monitoring Tool

Source: Internet
Author: User

In the performance testing process, it is of great significance to monitor host resources. On the one hand, during the test, you can determine whether the pressurization is successful and whether the system can withstand the current pressure to ensure system security. On the other hand, after the test, you can sort the monitoring data, it can provide data support for performance analysis, problem discovery, and bottleneck search. This article will introduce the common resource monitoring tool NMON and its usage in Unix and Linux operating systems based on the actual situation in the work.

1. Introduction to NMON

Nmon is a monitoring and analysis tool widely used in AIX and various Linux operating systems. The information recorded by nmon is comprehensive, it can capture the usage of system resources in real time during system operation and output the results to files. The nmon tool can display all important performance optimization information on a single screen and dynamically update it. In addition, nmon does not occupy too many system resources. Generally, the CPU usage does not exceed 2%.

For different operating system versions, nmon has a corresponding version of the program. Note that the file must be authorized to run properly.

Ii. Usage of NMON

In practice, nmon has three common usage modes: Real-time Monitoring, background monitoring, and regular monitoring. The following sections describe them respectively.

1. Real-time Monitoring: After completing the configuration, you only need to run the/nmon command to run the program. You can use some shortcut keys to retrieve system resource metrics for display. For example, press "C" to view CPU information, and press "D" to view disk information; press "T" to view the process information of the System. "M" corresponds to the memory, "N" corresponds to the network, and so on. you can click "H" to view the complete content of the shortcut key, 1. The NMON real-time monitoring interface displays the CPU, memory, and process information of the Linux system, including the CPU user, system, waiting, and idle Status values, detailed metrics such as available memory, cache size, and CPU consumption of processes. This method provides real-time information display, allowing you to know the running conditions under the system's pressure in a timely manner, including the CPU utilization, memory usage, network traffic, disk read/write, etc ...... These data are refreshed in real time and displayed at a glance. However, if we want to record the resources for a period of time for subsequent analysis, we need to use nmon in another way.

 

Figure 1 NMON Real-time Monitoring page

2. Background monitoring: in order to cooperate with performance testing, we often need to record the system resource consumption in a period of time. In this case, you can use the command :. /nmon-f-s 10-c 360. Note:

-F: name of the output file in standard format:

-S: sampling once every n seconds. The value here is 10 seconds.

-C: How many samples are taken out. Here, the sampling quantity is 360, that is, monitoring = 10*360/3600 = 1 hour.

After the command is started, a monitoring file is generated in the directory where nmon is located, and resource data is continuously written until the collection of 360 monitoring sites is completed-that is, monitoring is completed for one hour, the tester can continue to perform other operations without manual intervention. If you want to stop the monitoring, You need to query the process number through "# ps-ef | grep nmon", and then kill the process to stop monitoring.

3. Regular monitoring: in addition to short-term monitoring of performance testing, we can also implement regular monitoring of the system as a reference for the operation and maintenance phase. You can run the "# crontab-e" command to perform regular monitoring. Add "0 8 ** 1200, 5/nmon-f-s 30-c" to the last line ", indicates that the monitoring period starts from a.m. from Monday to Friday and ranges from 10 hours to a.m ).

Iii. Analysis of NMON monitoring results

Through background monitoring and regular monitoring, we can obtain monitoring files with the extension nmon, which record the data of system resources and need to be interpreted with analysis tools. Nmon analyser.xls can convert. nmon files into Excel files and generate statistical charts to intuitively display system resources. 2. The system resource summary shows the overall usage of the system CPU and IO resources. The blue curve indicates the CPU resources. We can see that the CPU usage fluctuates up or down 70% during the test. This indicates that the system has sufficient utilization of CPU resources, no bottlenecks, or insufficient resources.

 

Figure 2 system resource Summary

During the testing process, we often need more detailed information to analyze the system performance. If we think that the disk IO is too high, we need to further obtain detailed information about the disk for analysis, in the nmon result, open the "DISK_SUMM" tab. 3. Disk resource summary.

 

Figure 3 disk resource Summary

The observed results show that the disk writes a large amount of data and the average value reaches KB per second. This can be determined as the main cause of high disk I/O. The cause of the problem can be further determined based on the actual settings of the system, for example, the system log level is too low. NMON can provide information about CPU, memory, hard disk, network, and other aspects. It can provide good data support for our analysis work.

In addition, we can adjust some output parameters to obtain statistics results with different angles or forms. The commonly used "Intervals" parameter defines the original. the value range of the nmon file, that is, the part of the statistical content taken from the original data. Because the raw data is a collection of multiple sampling points, you can set the start and end values of "Intervals. For example, if the start value is 1 and the end value is 60, the preceding settings show that the data is captured for the first 10 minutes)

Summary: This article introduces the host Resource Monitoring Tool NMON suitable for Unix and Linux operating systems, and briefly describes its usage and common monitoring methods. In actual projects, in order to establish a sound monitoring system, we may also need to work with other tools and methods to achieve our testing objectives.
 

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.