分类: 敏捷实践2010-06-08 11:27 7458人阅读 评论(0) 收藏 举报
 

目录(?)[+]

 

1. nmon概述

1.1. 概述

nmon是收集AIX或Linux主机的性能数据并分析的工具,使用简单易用。主要有两个,一个是nmon采集数据的工具,一般名称为nmon_**,例如nmon_aix5.3,另一个是分析结果的工具,它是一个excel的文件,名称为:nmon analyser v33A.xls。

nmon在一个屏幕上显示所有重要的性能优化信息,并动态地对其进行更新。还可以将相同的数据捕获到一个文本文件,便于以后对报告进行分析和绘制图形。

nmon_analyser 工具以 NMON 性能工具生成的文件作为输入,然后将它们转换为 Microsoft Excel 电子表格,并自动地生成相应的图形。

nmon 工具可以为 AIX 和 Linux 性能专家提供监视和分析性能数据的功能,其中包括:

l CPU 使用率

l 内存使用情况

l 内核统计信息和运行队列信息

l 磁盘 I/O 速度、传输和读/写比率

l 文件系统中的可用空间

l 磁盘适配器

l 网络 I/O 速度、传输和读/写比率

l 页面空间和页面速度

l 消耗资源最多的进程

l 计算机详细信息和资源

IBM 没有提供对该工具的正式支持,并且您在使用它的时候必须自己承担相应的风险,但是您可以从中获得大量有价值的性能统计信息。其中,nmon for linux版本已经在2009年7月27日开放源码。

1.2. 适用范围

本文档为使用nmon作为性能测试中监控linux服务器的应用,提供使用规范和帮助。

1.3. 词汇表

词汇

解释

Nmon

性能数据收集分析工具

Nmon analyser

性能数据分析工具,excel文件

nmon_x86_sles10

Nmon在x86_sles10下二进制执行文件

1.4. 参考资料

Nmon在IBM的官方网站

http://www.ibm.com/developerworks/wikis/display/WikiPtype/nmon

nmon for linux的官方网站

http://nmon.sourceforge.net/pmwiki.php

文章一:《nmon 性能:分析 AIX 和 Linux 性能的免费工具》

http://www.ibm.com/developerworks/cn/aix/library/analyze_aix/

文章二:《nmon analyser——生成 AIX 性能报告的免费工具》

http://www.ibm.com/developerworks/cn/aix/library/nmon_analyser/index.html

1.5. 获取该工具

下载nmon工具的可执行文件nmon_x86_sles10。

http://nmon.sourceforge.net/pmwiki.php?n=Site.Download

也可以下载源码自己编译特定的版本。(推荐这个)

http://nmon.sourceforge.net/pmwiki.php?n=Site.CompilingNmon

下载nmon Analyser V3.3

http://www.ibm.com/developerworks/wikis/display/Wikiptype/nmonanalyser

下载nmon Consolidator

http://www.ibm.com/developerworks/wikis/display/WikiPtype/nmonconsolidator

ibm的其他性能测试工具

http://www.ibm.com/developerworks/wikis/display/WikiPtype/Performance+Other+Tools

2. nmon

2.1. 安装

该工具是一个独立的二进制文件(不同的 AIX 或 Linux 版本中该文件也有所不同)。安装过程非常简单:

1. 将 nmon_x86_sles10文件复制到计算机,rz—>在弹出框选择nmon_x86_sles10。

2. 修改nmon_x86_sles10的文件权限,chmod 777 ./nmon_x86_sles10

3. 要启动 nmon 工具,输入 ./ nmon_x86_sles10。

2.2. 运行

Nmon可以交互式运行

l 启动该工具 ./ nmon_x86_sles10

l 使用单键命令来查看您所需要的数据。例如,要获取 CPU、内存和磁盘统计信息,启动 nmon 并输入: c m d

l 获取相关的帮助信息,按 h 键。

使用下面这些键来切换显示状态:

c = CPU l = CPU Long-term  - = Faster screen updates

m = Memory j = Filesystems + = Slower screen updates

d = Disks n = Network V = Virtual Memory

r = Resource N = NFS v = Verbose hints

k = kernel t = Top-processes . = only busy disks/procs

h = more options q = Quit

2.3. 捕获数据到文件

捕获数据到文件,只要运行带 -f 标志的 nmon 命令。执行nmon –f ***后,nmon 将转为后台运行。要查看该进程是否仍在运行,可以输入: ps -ef | grep nmon。

示例:

每1秒捕获数据快照,捕获20次

nmon –f -s 1 -c 20

每30秒捕获数据快照,捕获120次,包含进程信息

nmon –ft -s 30 -c 120

命令将在当前目录中创建输出文件,其名称为: <hostname>_date_time.nmon。该文件采用逗号分隔值 (CSV) 的格式,并且可以将其直接导入到电子表格中,可进行分析和绘制图形

2.4. Nmon界面

进入界面

监控界面一

监控界面二

3. nmon_analyser

nmon_analyser 工具以 NMON 性能工具生成的文件作为输入,然后将它们转换为 Microsoft Excel 电子表格,并自动地生成相应的图形。

使用wps未能正确执行脚本生成*.xls文件。建议Excel™ 2000 或更高版本,必须在打开nmon_analyser选择启用宏。

nmon_analyser 工具设计用于最新版本的 nmon,但出于向后兼容性的考虑,也使用旧版本对其进行了测试。每当在对 nmon 进行更新时,同时也将对该工具进行更新,

4. 附录

4.1. Nmon帮助信息

参阅 nmon –h

Hint: nmon_x86_sles10 [-h] [-s <seconds>] [-c <count>] [-f -d <disks> -t -r <name>] [-x]

-h            FULL help information

Interactive-Mode:

read startup banner and type: "h" once it is running

For Data-Collect-Mode (-f)

-f            spreadsheet output format [note: default -s300 -c288]

optional

-s <seconds>  between refreshing the screen [default 2]

-c <number>   of refreshes [default millions]

-d <disks>    to increase the number of disks [default 256]

-t            spreadsheet includes top processes

-x            capacity planning (15 min for 1 day = -fdt -s 900 -c 96)

Version - nmon 12c

For Interactive-Mode

-s <seconds>  between refreshing the screen [default 2]

-c <number>   of refreshes [default millions]

-g <filename> User Defined Disk Groups [hit g to show them]

- file = on each line: group_name <disks list> sapce separated

- like: database sdb sdc sdd sde

- upto 32 disk groups, disks can appear more than once

-b            black and white [default is colour]

example: nmon_x86_sles10 -s 1 -c 100

For Data-Collect-Mode = spreadsheet format (comma separated values)

Note: use only one of f,F,z,x or X and make it the first argument

-f            spreadsheet output format [note: default -s300 -c288]

output file is <hostname>_YYYYMMDD_HHMM.nmon

-F <filename> same as -f but user supplied filename

-r <runname>  goes into spreadsheet file [default hostname]

-t            include top processes in the output

-T            as -t plus saves command line arguments in UARG section

-s <seconds>  between snap shots

-c <number>   of refreshes

-d <disks>    to increase the number of disks [default 256]

-l <dpl>      disks/line default 150 to avoid spreadsheet issues. EMC=64.

-g <filename> User Defined Disk Groups (see above)

-N            include NFS Network File System

-I <percent>  Include precoess and disks busy threshold (default 0.1)

don't save or show proc/disk using less than this percent

-m <directory> nmon changes to this directory before saving to file

-D            Skip disk configuration sections

example: collect for 1 hour at 30 second intervals with top procs

nmon_x86_sles10 -f -t -r Test1 -s30 -c120

To load into a spreadsheet like Lotus 1-2-3:

sort -A *nmon >stats.csv

transfer the stats.csv file to your PC

Start 1-2-3 and then Open <char-separated-value ASCII file>

Capacity planning mode - use cron to run each day

-x            sensible spreadsheet output for CP =  one day

every 15 mins for 1 day ( i.e. -ft -s 900 -c 96)

-X            sensible spreadsheet output for CP = busy hour

every 30 secs for 1 hour ( i.e. -ft -s 30 -c 120)

Set-up and installation

- this adds the disk % busy numbers (otherwise they are zero)

If you have hundreds of disk this can take 1% to 2% CPU

Interactive Mode Commands

key --- Toggles to control what is displayed ---

h   = Online help information

r   = Machine type, machine name, cache details and OS version + LPAR

c   = CPU by processor stats with bar graphs

l   = long term CPU (over 75 snapshots) with bar graphs

m   = Memory stats

V   = Virtual Memory and Swap stats

k   = Kernel Internal stats

n   = Network stats and errors

N   = NFS Network File System

d   = Disk I/O Graphs

D   = Disk I/O Stats

o   = Disk I/O Map (one character per disk showing how busy it is)

b   = black and white mode (or use -b option)

.   = minimum mode i.e. only busy disks and processes

key --- Other Controls ---

+   = double the screen refresh time

-   = halves the screen refresh time

q   = quit (also x, e or control-C)

0   = reset peak counts to zero (peak = ">")

space = refresh screen now

Startup Control

If you find you always type the same toggles every time you start

then place them in the NMON shell variable. For example:

export NMON=cmdrvtan

Others:

a) To you want to stop nmon - kill -USR2 <nmon-pid>

b) Use -p and nmon outputs the background process pid

c) To limit the processes nmon lists (online and to a file)

Either set NMONCMD0 to NMONCMD63 to the program names

or use -C cmd:cmd:cmd etc. example: -C ksh:vi:syncd

d) If you want to pipe nmon output to other commands use a FIFO:

mkfifo /tmp/mypipe

nmon -F /tmp/mypipe &

grep /tmp/mypipe

e) If nmon fails please report it with:

1) nmon version like: 12c

2) the output of cat /proc/cpuinfo

3) some clue of what you were doing

4) I may ask you to run the debug version

Copyright 2009 Nigel Griffiths

GNU General Public License <http://www.gnu.org/licenses/>.

Feedback welcome - http:/nmon.sourceforge.net

No warranty given or implied.

附录二:nmon参数:
参考http://www.ibm.com/developerworks/wikis/display/Wikiptype/nmonanalyser
nmon: 
-f            spreadsheet output format [note: default -s300 -c288]
           Output file is <hostname>_YYYYMMDD_HHMM.nmon

-F <filename>  same as -f but user supplied filename
-c <number>    number of snapshots
-d      requests disk service and wait times (DISKSERV and DISKWAIT)
-i <percent>   Ignore processes using less than this amount of CPU when generating TOP section – useful for reducing data volumes
-g <filename> file containing disk group definitions
-l <dpl>  number of hdisks per sheet - defaults to 150, maximum 250.  See notes
-m <dir>    NMON changes to this directory before saving the file
-r <runname>   goes into spreadsheet file [default hostname]
-s <seconds>   interval between snap shots
-x   capacity planning (15 mins for 1 day = -fdt -s900 -c96) 
 -t           include top processes in the output
-T           as –t plus saves command line arguments in UARG section
-A          include data for async I/O (PROCAIO) sections
-D prevents DISK sections being produced (useful when Disk Groups are being used because there are too many hdisks to process)
-E          stops ESS sections being produced (necessary when Disk Groups are being used because there are too many vpaths to process)
-J  prevents JFS sections being produced (prevents Excel errors when you have more than 255 filesystems)
-L includes LARGEPAGE section
-N include NFS sections
-S include WLM sections with subclasses
-W include WLM sections without subclasses
-Y include SUMMARY section (very efficient alternative to –t if PID level data is not required)

example: nmon_aix51 -F asterix.nmon -r Test1 -s6 -c12

版权声明:本文为博主原创文章,未经博主允许不得转载。

nmon的使用的更多相关文章

  1. 监控Linux系统性能的工具--nmon(一)

    今天看到一资料上写着,nmon可以对linux系统进行性能监控,随手在自己的阿里云上敲了一下这个命令,提示'command not find' 一脸懵~,然后探索了一下如何安装这个工具以及如何更好的查 ...

  2. nmon的安装

    安装 mkdir /usr/local/nmon cd /usr/local/nmon wget http://sourceforge.net/projects/nmon/files/nmon_lin ...

  3. nmon监控工具的使用

    该工具的使用主要参考自http://blog.itpub.net/23135684/viewspace-626439/ http://nmon.sourceforge.net/pmwiki.php 生 ...

  4. Linux下使用NMON监控、分析系统性能

    一.下载nmon. 根据CPU的类型选择下载相应的版本:http://nmon.sourceforge.net/pmwiki.php?n=Site.Downloadwget http://source ...

  5. nmon工具的安装及简单使用

    1.工具的安装 下载rpm包安装即可http://mirror.ghettoforge.org/distributions/gf/el/6/gf/x86_64/nmon-14i-1.gf.el6.x8 ...

  6. Linux资源监控(Nmon)

    1.下载nmon_linux_14g.tar.gz 2.解压nmon_linux_14g.tar.gz #tar -zxvf nmon_linux_14g.tar.gz 3. 为nmon_x86_64 ...

  7. NMON中的各项参数指标

    一.NMON中的各项参数指标: SYS_SUMM:显示当前服务器的总体性能情况 Total System I/OStatistics:Avg tps during an interval:显示采集间隔 ...

  8. CentOS6.4 安装nmon

    安装 mkdir /usr/local/nmon cd /usr/local/nmon wget http://sourceforge.net/projects/nmon/files/nmon_lin ...

  9. Centos5下安装监控工具nmon

    一.nmon下载地址http://nmon.sourceforge.net/pmwiki.php?n=Site.Download 二.下载centos5对应版本nmon_linux_14i.tar.g ...

  10. 使用nmon监控服务器性能

    1.下载nmon:http://nmon.sourceforge.net/pmwiki.php?n=Site.Download 2.选择适合Linux系统版本的相应nmon版本,Linux查看系统版本 ...

随机推荐

  1. Xshell 或者 Xftp 突然连不上阿里云

    今天突然发现使用xshell 远程连接不上阿里云,废了好大的劲,才明白的差不多.只要不出意外有以下几种情况:1.安全组中有没有你需要连接的端口,2.防火墙是否关闭,3.端口是否开放权限,4.是否安装了 ...

  2. 手动漏洞挖掘-SQL注入(安全牛笔记)

    substring_index(USER(),"@",l)-- #是将查询出来的结果进行切分,以@符号的方式切分 ’ union select table_name,table_s ...

  3. Linux常用监控命令

    A goal is a dream with a deadline. Much effort, much prosperity.  1.IOSTAT命令 此命令安装包为sysstat     可用yu ...

  4. yum安装mysql后root用户的临时密码

    1.查看root用户临时随机密码 yum 安装mysql后,无法通过空密码登录数据库,如下: [root@ mysql]# mysql -u root -p Enter password: ERROR ...

  5. 【I/O】File常见用法总结

    java.io.File file可能是一个文件或者文件夹. 获取目录列表(全部/过滤) import java.io.File; import java.io.FilenameFilter; imp ...

  6. [洛谷3041]视频游戏的连击Video Game Combos

    题目描述 Bessie is playing a video game! In the game, the three letters 'A', 'B', and 'C' are the only v ...

  7. centos7 -lvm卷组

    老忘,记一下   基本的逻辑卷管理概念: PV(Physical Volume)- 物理卷 物理卷在逻辑卷管理中处于最底层,它可以是实际物理硬盘上的分区,也可以是整个物理硬盘,也可以是raid设备. ...

  8. idea技巧

    写在前面 以前一直用的elipce,如今入坑IntelliJ IDEA,没想到啊.深深的爱上了它,强大到无所不能: "工欲善其事必先利其器",IntelliJ IDEA作为一个非常 ...

  9. java中set集合的常用方法

    因为Set集合也是继承Collection集合 所以这里就不讲继承Collection集合的方法 都是继承Collection集合的方法 https://www.cnblogs.com/xiaostu ...

  10. on绑定阻止冒泡失败

    使用zepto库,有如下dom <div id="J_parent"> <a href="#"> <span>点我有惊喜&l ...