压测监控 Nmon

1、Nmon 下载

  • 网盘地址
链接:  https://pan.baidu.com/s/1znAhcEZ2dd8tZpI4bpE2-g 
提取码:r8s4
(包含 nmon16m_helpsystems.tar.gz、nmon_analyser_v66.zip)
  • 官网地址
http://nmon.sourceforge.net/pmwiki.php?n=Site.Download

2、Nmon 安装

  • 将下载好的 nmon16m_helpsystems.tar.gz 文件上传(上传工具 WinSCP、Xftp等工具)至服务
[fly@localhost ~]$ ll
总用量 7060
-rw-r--r--. 1 root root 7222481 5月   7 21:20 nmon16m_helpsystems.tar.gz
  • 将文件解压至指定目录 如:nmon
[fly@localhost ~]$ mkdir nmon    #创建该目录
[fly@localhost ~]$ ll
总用量 7060
drwxrwxr-x. 2 fly  fly     4096 5月   7 21:24 nmon
-rw-r--r--. 1 root root 7222481 5月   7 21:20 nmon16m_helpsystems.tar.gz
[fly@localhost ~]$ tar -zxvf nmon16m_helpsystems.tar.gz -C nmon   #解压
nmon_power_64_centos6
nmon_power_64_centos7
nmon_power_64_linux
nmon_power_64_rhel6
nmon_power_64_rhel7
nmon_power_64_sles11
nmon_power_64le_centos7
nmon_power_64le_centos8
nmon_power_64le_linux
nmon_power_64le_rhel7
nmon_power_64le_rhel7_gpu
nmon_power_64le_rhel8
nmon_power_64le_sles12
nmon_power_64le_ubuntu14
nmon_power_64le_ubuntu16
nmon_power_64le_ubuntu18
nmon_x86_64_centos5
nmon_x86_64_centos6
nmon_x86_64_centos7
nmon_x86_64_centos8
nmon_x86_64_debian08
nmon_x86_64_debian09
nmon_x86_64_debian10
nmon_x86_64_mint18
nmon_x86_64_mint19
nmon_x86_64_oel5
nmon_x86_64_oel6
nmon_x86_64_oel7
nmon_x86_64_oel8
nmon_x86_64_opensuse10
nmon_x86_64_opensuse11
nmon_x86_64_opensuse12
nmon_x86_64_opensuse15
nmon_x86_64_rhel5
nmon_x86_64_rhel6
nmon_x86_64_rhel7
nmon_x86_64_rhel8
nmon_x86_64_sles10
nmon_x86_64_sles11
nmon_x86_64_sles12
nmon_x86_64_sles15
nmon_x86_64_ubuntu14
nmon_x86_64_ubuntu16
nmon_x86_64_ubuntu18
nmon_x86_64_ubuntu19
  • 解压结果
[fly@localhost ~]$ cd nmon
[fly@localhost nmon]$ ll
总用量 19340
-rwxr-----. 1 fly fly 415229 2月  19 06:51 nmon_power_64_centos6
-rwxr-----. 1 fly fly 465584 2月  19 06:42 nmon_power_64_centos7
-rwxr-----. 1 fly fly 463336 2月  19 07:41 nmon_power_64le_centos7
-rwxr-----. 1 fly fly 519424 2月  19 07:55 nmon_power_64le_centos8
-rwxr-----. 1 fly fly 519424 2月  19 08:16 nmon_power_64le_linux
-rwxr-----. 1 fly fly 463336 2月  19 07:40 nmon_power_64le_rhel7
-rwxr-----. 1 fly fly 470232 2月  18 05:30 nmon_power_64le_rhel7_gpu
-rwxr-----. 1 fly fly 519424 2月  19 08:09 nmon_power_64le_rhel8
-rwxr-----. 1 fly fly 466488 2月  19 07:15 nmon_power_64le_sles12
-rwxr-----. 1 fly fly 545407 2月  19 08:09 nmon_power_64le_ubuntu14
-rwxr-----. 1 fly fly 559744 2月  19 08:09 nmon_power_64le_ubuntu16
-rwxr-----. 1 fly fly 545584 2月  19 08:14 nmon_power_64le_ubuntu18
-rwxr-----. 1 fly fly 465584 2月  19 08:17 nmon_power_64_linux
-rwxr-----. 1 fly fly 415229 2月  19 06:51 nmon_power_64_rhel6
-rwxr-----. 1 fly fly 465584 2月  19 06:44 nmon_power_64_rhel7
-rwxr-----. 1 fly fly 437504 2月  19 07:10 nmon_power_64_sles11
-rwxr-----. 1 fly fly 331875 2月  20 05:08 nmon_x86_64_centos5
-rwxr-----. 1 fly fly 350222 2月  20 05:08 nmon_x86_64_centos6
-rwxr-----. 1 fly fly 404896 2月  20 05:18 nmon_x86_64_centos7
-rwxr-----. 1 fly fly 472080 2月  20 05:52 nmon_x86_64_centos8
-rwxr-----. 1 fly fly 292808 2月  20 02:04 nmon_x86_64_debian08
-rwxr-----. 1 fly fly 410960 2月  20 02:46 nmon_x86_64_debian09
-rwxr-----. 1 fly fly 477600 2月  20 02:57 nmon_x86_64_debian10
-rwxr-----. 1 fly fly 493432 2月  20 07:45 nmon_x86_64_mint18
-rwxr-----. 1 fly fly 497768 2月  20 07:55 nmon_x86_64_mint19
-rwxr-----. 1 fly fly 331875 2月  20 05:53 nmon_x86_64_oel5
-rwxr-----. 1 fly fly 350222 2月  20 05:53 nmon_x86_64_oel6
-rwxr-----. 1 fly fly 404896 2月  20 05:53 nmon_x86_64_oel7
-rwxr-----. 1 fly fly 472080 2月  20 05:53 nmon_x86_64_oel8
-rwxr-----. 1 fly fly 330378 2月  20 07:26 nmon_x86_64_opensuse10
-rwxr-----. 1 fly fly 356840 2月  20 07:26 nmon_x86_64_opensuse11
-rwxr-----. 1 fly fly 411760 2月  20 07:26 nmon_x86_64_opensuse12
-rwxr-----. 1 fly fly 409168 2月  20 07:26 nmon_x86_64_opensuse15
-rwxr-----. 1 fly fly 331875 2月  20 05:53 nmon_x86_64_rhel5
-rwxr-----. 1 fly fly 350222 2月  20 05:54 nmon_x86_64_rhel6
-rwxr-----. 1 fly fly 404896 2月  20 05:54 nmon_x86_64_rhel7
-rwxr-----. 1 fly fly 472080 2月  20 05:54 nmon_x86_64_rhel8
-rwxr-----. 1 fly fly 330378 2月  20 07:04 nmon_x86_64_sles10
-rwxr-----. 1 fly fly 356840 2月  20 07:04 nmon_x86_64_sles11
-rwxr-----. 1 fly fly 411760 2月  20 07:04 nmon_x86_64_sles12
-rwxr-----. 1 fly fly 409168 2月  20 07:19 nmon_x86_64_sles15
-rwxr-----. 1 fly fly 471446 2月  20 02:04 nmon_x86_64_ubuntu14
-rwxr-----. 1 fly fly 493432 2月  20 02:04 nmon_x86_64_ubuntu16
-rwxr-----. 1 fly fly 497768 2月  20 02:04 nmon_x86_64_ubuntu18
-rwxr-----. 1 fly fly 597336 2月  20 02:04 nmon_x86_64_ubuntu19

3、Nmon 使用

  • 查看服务版本
[fly@localhost nmon]$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
  • 运行 nmon 运行对应的文件
    nmon
[fly@localhost nmon]$ ./nmon_x86_64_centos7
lnmonq16mqqqqqq[H for help]qqqHostname=localhostqqqqRefresh= 2secs qqq21:55.42qqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                                                                                                        x
x   ------------------------------                                                                       x
x    _ __  _ __ ___   ___  _ __    	 For help type H or ...                                              x
x   | '_ \| '_ ` _ \ / _ \| '_ \          nmon -?  - hint                                                x
x   | | | | | | | | | (_) | | | |         nmon -h  - full details                                        x
x   |_| |_|_| |_| |_|\___/|_| |_|                                                                        x
x                                        To stop nmon type q to Quit                                     x
x   ------------------------------                                                                       x
x                                                                                                        x
x   CentOS Linux release 7.4.1708 (Core)  VERSION="7 (Core)"                                             x
x   Vendor=AuthenticAMD Model=AMD A6-3420M APU with Radeon(tm) HD Graphics                               x
x   MHz=1496.628 bogomips=2994.61          lscpu:CPU=4 Little Endian                                     x
x   ProcessorChips=2 PhysicalCores=2             Sockets=0 Cores=2 Thrds=1                               x
x                    VirtualCPUs =4              MHz=0 max=0 min=0                                       x
x                                                                                                        x
x   Use these keys to toggle statistics on/off:                                                          x
x     c = CPU         l = CPU Long-term     - = Faster screen updates                                    x
x     C = " WideView  U = Utilisation       + = Slower screen updates                                    x
x     m = Memory      V = Virtual memory    j = File Systems                                             x
x     d = Disks       n = Network           . = only busy disks/procs                                    x
  • 参数详解
q : 停止并退出 Nmon
h : 查看帮助
c : 查看 CPU 统计数据
m : 查看内存统计数据
d : 查看硬盘统计数据
k : 查看内核统计数据
n : 查看网络统计数据
N : 查看 NFS 统计数据
j : 查看文件系统统计数据
t : 查看高耗进程
V : 查看虚拟内存统计数据
v : 详细模式

4、Nmon 数据采集

  • 压力测试时,需要根据测试场景的执行情况,分析一段时间内系统资源的变化,这时需要nmon采集数据并保存下来,以下是参数详解:
[fly@localhost nmon]$ ./nmon_x86_64_centos7 --help
./nmon_x86_64_centos7: invalid option -- '-'
Hint for nmon_x86_64_centos7 version 16m
	Full Help Info : nmon_x86_64_centos7 -h

	On-screen Stats: nmon_x86_64_centos7
	Data Collection: nmon_x86_64_centos7 -f [-s <seconds>] [-c <count>] [-t|-T]
	Capacity Plan  : nmon_x86_64_centos7 -x
Interactive-Mode:
	Read the Welcome screen & at any time type: "h" for more help
	Type "q" to exit nmon

For Data-Collect-Mode
	-f            Must be the first option on the line (switches off interactive mode)
	              Saves data to a CSV Spreadsheet format .nmon file in then local directory
	              Note: -f sets a defaults -s300 -c288    which you can then modify
	Further Data Collection Options:
	-s <seconds>  time between data snapshots
	-c <count>    of snapshots before exiting
	-t            Includes Top Processes stats (-T also collects command arguments)
	-x            Capacity Planning=15 min snapshots for 1 day. (nmon -ft -s 900 -c 96)
---- End of Hints
[fly@localhost nmon]$ 
     -f 参数:生成文件,文件名=主机名+当前时间.nmon

     -T 参数:显示资源占有率较高的进程

     -s 参数:-s 10表示每隔10秒采集一次数据

     -c 参数:-s 10表示总共采集十次数据

     -m 参数:指定文件保存目录,默认当前目录
  • nmon 常用参数
nmon -f -s 5 -c 12   # 5s 记录一次,采集 12次
  • 生成文件如下,将该文件下载至 windows 端。
[fly@localhost nmon]$ ls
localhost_200507_2124.nmon 

5、Nmon Analyser 数据分析

  • 将文件 nmon_analyser_v66.zip 本地解压,打开 其中的 Execl 文件
nmon analyser v66.xlsm
  • 打开该文件 (以Office 2013 为例),选择 “不更新”,并启用
    在这里插入图片描述
  • 双击 表格中的 Analyze nmon data 按钮,选择 我们要转换的 .nmon 文件
    Analyze nmon data
  • 提示另存为,选择地址保存即可
    在这里插入图片描述
  • 下图为转换后的 表格,可切换不同的 Sheet页查看
    在这里插入图片描述
    在这里插入图片描述
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值