Performance testing - server monitoring tool nmon

insert image description here


1. Introduction to performance monitoring tool nmon

For performance testing, server monitoring is very important. Using the nmon command can easily capture the usage of system resources, which is convenient for performance analysis.

nmon is a monitoring and analysis tool widely used on AIX and various Linux operating systems.
It can capture the usage of system resources in real time during system operation, and the recorded information is relatively comprehensive.
It can monitor server system resource consumption. Collect and output a specific file, and use the excel analysis tool (nmon analyzer) for statistical analysis of the data

2. The data types that can be monitored by nmon

CPU usage
Memory usage Disk
adapter
Free space in the file system
Paging space and page speed
Asynchronous I/O, AIX
Network File System (NFS)
disk I/O speed, transfer and read/write ratio
Server details and Resources
Kernel statistics
Top resource consuming processes
Run queue information

Three, nmon characteristics

1. The operation of nmon will not occupy too much system resources, and the CPU utilization rate will not exceed 2% under normal circumstances. 2. Powerful functions and comprehensive monitoring
data types.
Monitored data
4. Good portability and compatibility
5. Unattended monitoring
6. You can view the monitoring results in real time, or you can view the monitoring results locally after the test is over

4. Installation under Linux

1. Check the installation environment

[root@mylinux1 ~]# uname -a
Linux mylinux1 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

2. Download nmon

I am here 3.10.0-1160.el7.x86_64

Official download link: https://sourceforge.net/projects/nmon/

3. Unzip

tar -zxvf nmon16m_helpsystems.tar.gz

insert image description here

Five, run nmon

1. Start nmon

For the convenience of running, we will rename the nmon_*** file to nmon, first find the file corresponding to the operating system, here is nmon_x86_64_centos7, and rename it to nmon, the command is as follows:

[root@mylinux1 nmon]# mv nmon_x86_64_centos7 nmon

Then run nmon and simply type ./

./nmon

insert image description here

2. Commonly used nmon shortcut commands

q : stop and exit nmon
h : view help
c : view CPU stats
m : view memory stats
d : view disk stats
k : view kernel stats
n : view network stats
N : view NFS stats
j : view files System statistics
t: View high-consuming processes
V: View virtual memory statistics
v: Detailed mode
insert image description here
Press multiple shortcut commands to display multiple monitoring results at the same time until the current screen is full.

3. nmon command line parameters

The above shortcut command can only display the current system resources on the screen in real time, and cannot save them to a file. If you want to save the results to a file for analysis, you need to use command line parameters. When starting nmon, you can specify the following parameters

f: The monitoring results are output in the form of files, **Default: **Machine name_date_time.nmon
-F: Same effect as -f, but you need to specify the output file name
-s: Sampling frequency, unit second
-c: Sampling Number of times
-m: the directory where the nmon file is saved
-t: display processes with high resource usage

4. Command line example

Collect system resource data every 10s, 6 times in total (6 times within 1 min), and generate the final nmon file in the /data directory

./nmon -f -t -s 10 -c 6 -m /data
[root@mylinux1 nmon]# cd data
[root@mylinux1 data]# ls
mylinux1_230521_0041.nmon

Transfer this .nmon file locally for subsequent analysis of results

5. Focus

Generally speaking, it is not recommended to use nmon monitoring for stability testing (stress testing), because when the generated nmon file exceeds 10M, the analysis tool will report an error due to insufficient memory. If necessary, it is recommended to increase the sampling frequency and reduce the sampling frequency (
low at 330 times)

6. View nmon monitoring results

1. Introduction to nmon_analyser

The information captured by nmon monitoring is generally analyzed by nmon_analyser. Nmon_analyser
is provided by IBM. It uses excel macro commands to analyze and load to generate excel charts to display various information of resource occupation.

2. Download nmon_analyser

Official website: https://nmon.sourceforge.net/pmwiki.php?n=Site.Nmon-Analyser
After decompression, there are two files
psd: description document
xlsm: macro file, analysis tool

[root@mylinux1 nmon_analyser]# unzip nmon_analyser_v69.zip 
Archive:  nmon_analyser_v69.zip
  inflating: nmon analyser v69_2.xlsm  
  inflating: NA_UserGuide v69.pdf    
[root@mylinux1 nmon_analyser]# ll
总用量 1400
-rw-r--r--. 1 root root 546610 1129 2021 NA_UserGuide v69.pdf
-rw-r--r--. 1 root root 208498 1118 2021 nmon analyser v69_2.xlsm
-rw-r--r--. 1 root root 674017 521 08:23 nmon_analyser_v69.zip

3. Run nmon_analyser

Open nmon analyzer v69_2.xlsm, remember to open it with excel through office or wps, and you need to start the macro
insert image description here

Guess you like

Origin blog.csdn.net/YZL40514131/article/details/130787651