分类: 敏捷实践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. Git和GitHub相关

    组员从GitHub上下载项目并上传项目的步骤如下 .组员接收到组长发的项目地址,组员需要从GitHub上把项目克隆下来,首先组员 需要在本地的一个文件夹里打开git,然后运行如下代码:git clon ...

  2. C语言中链接影响程序的细节

    参考:<深入理解计算机系统>  7.61节  链接器如何解析多重定义的全局符号 基本的原则是这样的:对于所有的全局符号,函数和已初始化的全局变量是强符号,未初始化的全局变量是弱符号. Un ...

  3. 异步编程——promise

    异步编程--promise 定义 Promise是异步编程的一个解决方案,相比传统的解决方法--回调函数,使用Promise更为合理和强大,避免了回调函数之间的层层嵌套,也使得代码结构更为清晰,便于维 ...

  4. Java Redis Pipeline 使用示例

    1. 参考的优秀文章 Request/Response protocols and RTT 2. 来源 原来,系统中一个树结构的数据来源是Redis,由于数据增多.业务复杂,查询速度并不快.究其原因, ...

  5. ggplot 画 条形图

    今天开会谈了半天自己的研究结果,同事皱着眉头,第一好像她没大听懂,第二感觉眼前一亮,但不知怎么落地.落地这个事情,交给时间吧,我想练熟我的分析. 今天搞了个简单的,条形图. 就是EXCEL里面经常玩的 ...

  6. Load事件

    Load事件 在 窗体完全呈现之后 被 触发 如下伪代码: void  ShowWindows { .....//显示父容器 .....//显示子容器 .....//显示控件 //至此,窗体完全呈现 ...

  7. Java中使用Log的方法

    一.java自带log:java.util.logging.Logger使用三步曲 public class HelloLogWorld { private static String name = ...

  8. visual stdio 2012 c#学习笔记1

    visual stdio 2012 c#学习笔记1 1 我在安装过程中选择的是英文版本,不过刚入手,所以想先从中文菜单入手,所以需要安装中文语言包: microsoft的中文语言包下载地址为:http ...

  9. UVALive 4270 Discrete Square Roots

    题目描述: 在已知一个离散平方根的情况下,按照从小到大的顺序输出其他所有的离散平方根. 在模n意义下,非负整数x的离散平方根是满足0<=r<n且r2=x(mod n)的整数r. 解题思路: ...

  10. hdu 5980 Find Small A(水,模拟)

    Find Small A Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tota ...