topas命令详解

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:topas命令详解

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

1.AIX系统版本

-bash-3.00$ oslevel
5.3.0.0

2.topas命令

Topas Monitor for host:    aix                  EVENTS/QUEUES    FILE/TTY
Sun Jan  8 12:51:10 2012   Interval:  2         Cswitch    5529  Readch    11620
                                                Syscall    6767  Writech 4357.3K
Kernel    1.7   |#                           |  Reads         7  Rawin         1
User      1.6   |#                           |  Writes       40  Ttyout      403
Wait      0.3   |#                           |  Forks         0  Igets         0
Idle     96.4   |############################|  Execs         0  Namei         6
                                                Runqueue    0.0  Dirblk        0
Network  KBPS   I-Pack  O-Pack   KB-In  KB-Out  Waitqueue   0.0
en0       0.9      2.0     3.0     0.3     0.7
lo0       0.1      1.0     1.0     0.0     0.0  PAGING           MEMORY
                                                Faults        8  Real,MB    1904
Disk    Busy%     KBPS     TPS KB-Read KB-Writ  Steals        0  % Comp     46
hdisk0   11.5     4.2K   27.5     0.0     4.2K  PgspIn        0  % Noncomp  11
hdisk1    0.0     0.0     0.0     0.0     0.0   PgspOut       0  % Client   11
cd0       0.0     0.0     0.0     0.0     0.0   PageIn        0
                                                PageOut    1064  PAGING SPACE
Name            PID  CPU%  PgSp Owner           Sios       1064  Size,MB     512
python      2400440   1.3   6.0 sutl                             % Used     43
python      2433268   1.2   6.8 sutl            NFS (calls/sec)  % Free     57
trclogio    1650830   0.3   0.5 matthewH        ServerV2       0
dtgreet      340036   0.1   1.3 root            ClientV2       0   Press:
topas       1953858   0.1   1.7 xifenfei        ServerV3       0   "h" for help
muxatmd      106652   0.0   0.6 root            ClientV3       0   "q" to quit
gil           69666   0.0   0.9 root
xmgc          49176   0.0   0.4 root
sshd        2257092   0.0   2.8 pillow
sshd        1101952   0.0   1.6 xifenfei
ping         848098   0.0   0.3 sylaryy
X            331840   0.0   1.6 root
bash        2756856   0.0   0.6 pillow
ctlcallp    1966120   0.0   0.2 aug_gucc
ctlsmsno    1622246   0.0   0.2 aug_gucc
jobcente    1237188   0.0   0.2 aug_gucc
sshd        1744962   0.0   0.9 nanmingy
searchpl    1015886   0.0   0.2 aug_gucc
ctlinfos     254072   0.0   0.3 aug_gucc
msgcente    1511494   0.0   0.2 aug_gucc

3.topas参数列表

 Usage: topas [-d number_of_monitored_hot_disks]
              [-h show help information]
              [-i monitoring_interval_in_seconds]
              [-m Use monochrome mode - no colors]
              [-n number_of_monitored_hot_network_interfaces]
              [-p number_of_monitored_hot_processes]
              [-w number_of_monitored_hot_WLM classes]
              [-c number_of_monitored_hot_CPUs]
              [-P show full-screen Process Display]
              [-L show full-screen Logical Partition display]
              [-U username - show username owned processes with -P]
              [-D show full-screen Disk display]
              [-W show full-screen WLM Display]
              [-C show full-screen Cross-LPAR (CEC) Panel]
              [-R background Cross-LPAR (CEC) Recording mode]
              [-I remote monitoring interval in seconds]
              [-o availmem=total memory size allocated in MB]
              [-o unavailmem=total memory size unallocated in MB]
              [-o availcpu=total cpus allocated on the HMC]
              [-o unavailcpu=total cpus unallocated on the HMC]
              [-o partitions=number of partitions defined on the HMC]
              [-o reconfig=reconf interval in sec 30/60(default)/90/120/180/240/300]
              [-o poolsize=defined Pool Size required if HMC PUA restricts access]
              [-o managedsys=managed system name under which this partition is configured]
              [-o hmc=HMC name under which this partition is configured]
              HMC configuration and recording information documented in:
                  /usr/lpp/perfagent/README.perfagent.tools

4.主要参数说明
-d:指定要监控的磁盘数。如果屏幕显示的区域足够大的话,这也是磁盘可显示的最大数。当这个数值超出实际安装的磁盘数,仅仅监控并显示安装磁盘的信息,默认为20.
-i:设置监控时间的间隔(秒),默认为2秒。
-n:设置被监控的网络接口数。这也是在屏幕上显示的最大网络接口数,当这个值超出了实际安装的网络接口数,仅仅监控并显示安装的网络接口信息。参数缺省值为20,如果这个值设为0,将没有网络信息被监控。
-p:指定被监控的进程数。这也是在屏幕上显示的最大进程数。缺省值为20,如果这个值为0,没见进程信息被监控。得到的这些进程信息是topas的主要开销。如果进程信息不需要,通常使用这个参数指定那些不想要的进程信息。
-w:指明被监控的WLM类的值。这也是在屏幕上显示的最大WLM值,当这个值超出了实际安装的WLM数,仅仅显示那些安装的WLM类的信息,缺省值为20,如果这个值为0,将没有信息显示。
-c:指明被监控的CPU数。这也是在屏幕上显示的最大CPU值,当这个值超出了实际安装的CPU数,仅仅显示那些安装的CPU的信息,缺省值为20,如果这个值为0,将没有信息显示。
-P:显示整个全屏进程显示。显示一系列最繁忙的进程,类似于默认显示的一部分,每个进程仅仅显示几列,可以通过任何列排序。
-W:显示全屏WLM(负载管理器)类。顶部显示一系列WLM类,类似于WLM类的一部分显示。
其实topas命令等同于:topas -d20 -i2 -n20 -p20 -w20 -c20

5.一些子命令说明
a 这个键显示所有被监控的(CPU,network,disk,WLM,process)不同部分。
c 这个键在累积报告和最忙的CPU之间进行切换。
d 这个键在最忙的磁盘和系统总的磁盘活动之间进行切换。
h 显示帮助信息。
n 这个键在最忙的接口和系统总的网络活动之间进行切换。
w 这个键在WLM类的开关之间切换。
p 这个键进程的开关之间切换。
P 这个键用全屏进程显示替换默认的显示。
W 这个键用全屏WLM类显示替换默认显示。
f 移动光标到一个WLM类上,这个键可以在WLM屏幕底端显示一系列进程情况。
q 退出程序。
r 更新显示。

6.topas内容说明
6.1)反映CPU使用率和工作状况
User%:进程所执行的用户态的状态占用的CPU百分比;
Kern%:进程所执行的内核态所占用CPU百分比;
Wait%:显示等待IO操作所占用的CPU百分比;
Idel%:显示CPU空闲的百分比。

6.2)反映网络使用率的状况
Interf:网络接口的名称;
KBPS:在监控期间每秒钟通过的以M为单位的总流量,这部分包括每秒钟接收和发送的总和。
I-Pack:在监控期间每秒钟接收到的数据包数;
O-Pack:在监控期间每秒钟发送的数据包数;
KB-In:在监控期间每秒钟接收到的字节数(以K为单位);
KB-Out:在监控期间每秒钟发送的字节数(以K为单位)。

6.3)反映磁盘使用率的状况
Disk:物理磁盘的名称;
Busy%:磁盘繁忙的百分比,即磁盘能满足的最大IOPS(每秒IO操作数)和当前IO数量的比率
KBPS:在监控期间每秒钟读写的字节数(以K为单位);
TPS:每秒钟物理磁盘的数据传输量。一次传输指的是一次I/O请求;
KB-Read:每秒钟从物理磁盘读出的K字节数;
KB-Write:每秒钟向物理磁盘写入的K字节数。

6.4)反映进程的状况
NAME:可执行程序的名称;
Process ID:进程的ID号;
%CPU Utilization:进程的CPU平均使用率,这个值指的是进程在生命周期中的平均使用率;
Paging Space Used:分配给进程的分页空间大小;
Process Owner:拥有这个进程的用户名;
Workload Management(WLM)Class:进程属于哪个WLM class。

6.5)EVENTS/QUEUES 状况
Cswitch:在监控期间每秒钟上下文转换的次数;
Syscall:在监控期间每秒钟运行系统呼叫的总次数;
Reads:在监控期间每秒钟运行读系统呼叫的次数;
Writes:在监控期间每秒钟运行写系统呼叫的次数;
Forks:在监控期间每秒钟运行派生系统呼叫的次数;
Execs:在监控期间每秒钟运行执行系统呼叫的次数;
Runqueue:等待处理器空闲以便运行的线程平均数;
Waitqueue:等待分页完成的线程平均数;

6.6)FILE/TTY 状况
Readch:在监控期间通过读系统呼叫每秒钟读出的字节数;
Writech:在监控期间通过写系统呼叫每秒钟写入的字节数;
Rawin:在监控期间通过TTYs每秒钟读入的裸字节数;
Ttyout:在监控期间每秒钟写入TTYs的字节数;
Igets:在监控期间每秒钟到节点查找例行程序的呼叫数;
Namei:在监控期间每秒钟路径查找例行程序的呼叫数;
Dirblk:在监控期间通过目录搜索例行程序每秒钟扫描到的目录块数;

6.7)PAGING部分显示的是分页每秒钟次数的统计
Faults:在监控期间每秒钟发生的分页错误总数;
Steals:在监控期间被虚拟内存管理器每秒钟偷走的物理内存4k的帧;
PgspIn:在监控期间每秒钟从分页空间中读取的4k分页数;
PgspOut:在监控期间每秒钟写入分页空间的4k分页数;
PageIn:在监控期间每秒钟读取的4k分页数,这包括从文件系统读操作相关的分页活动,从这个值减去PgspIn的值就是每秒钟从文件系统读操作相关的分页活动数;
PageOut:在监控期间每秒钟写入的4k分页数,这包括向文件系统写操作相关的分页活动,从这个值减去PgspOut的值就是每秒钟向文件系统写操作相关的分页活动数;
Sios:在监控期间通过虚拟内存管理器得到的I/O请求数;

6.8)Momory部分显示的是实际内存和在使用中的内存
Real,MB:以M为单位的实际内存;
%Comp:当前分配给计算分页片断的内存占实际内存的百分比。计算分页片断由分页空间产生。
%Nocomp:当前分配非计算分页片断的内存占实际内存的百分比。非计算分页片断包括那些文件空间,数据文件、可执行文件、或者共享库文件。
%Client:当前分配给用来缓冲远程挂载文件的内存占实际内存的百分比。

6.9)PAING SPACE显示分页空间的大小和使用率
Size,MB:系统里所有分页空间的大小,以M为单位;
%Used:当前使用的分页空间占总空间的百分比;
%Free:当前空闲的分页空间占总空间的百分比。

6.10)NFS (calls/sec)状况
Display NFS stats in calls per second

One thought on “topas命令详解

  1. Busy%:磁盘繁忙的百分比,即磁盘能满足的最大IOPS(每秒IO操作数)和当前IO数量的比率
    那么,磁盘能满足的最大IOPS,topas是如何计算的?
    另外Cswitch应该是上下文转换次数,Context Switch,非Content Switch吧。

  2. Kamus,
    Busy% Indicates the percentage of time the physical disk was active (bandwidth use for the drive).

  3. Syntax
           topas [ -d number_of_monitored_hot_disks ] [ -h ] [ -i monitoring_interval_in_seconds | recording_interval_in_seconds ] [ -n
           number_of_monitored_hot_network_interfaces ] [ -p number_of_monitored_hot_processes ] [ -w number_of_monitored_hot_WLM classes ] [ -c
           number_of_monitored_hot_CPUs ][ -I remote_polling_interval ] [ -U username_owned_processes ] | [ -Cn | -R [ -o field = value,... ] -D | -L |-P | -W
           ] [ -m]
    Description
           The topas command reports selected statistics about the activity on the local system. The command uses the curses library to display its output in a
           format suitable for viewing on an 80x25 character-based display or in a window of at least the same size on a graphical display. The topas command
           requires the bos.perf.tools and perfagent.tools filesets to be installed on the system.
           The topas command can also report a limited set of performance metrics from remote AIX partitions that belong to the same hardware platform. This
           support is described in the Cross-Partition View section.
           If the topas command is invoked without flags, it runs as if invoked with the following command line:
           topas -d20 -i2 -n20 -p20 -w20 -c20
           The program extracts statistics from the system with an interval specified by the monitoring_interval_in_seconds argument. The default output, as
           shown below, consists of two fixed parts and a variable section. The top two lines at the left of the display show the name of the system the topas
           command runs on, the date and time of the last observation, and the monitoring interval.
           The second fixed part fills the rightmost 25 positions of the display. It contains five subsections of statistics, as follows:
           EVENTS/QUEUES
                Displays the per-second frequency of selected system-global events and the average size of the thread run and wait queues:
                  Cswitch
                       The number of context switches per second over the monitoring interval.
                  Syscalls
                       The total number of system calls per second executed over the monitoring interval.
                  Reads
                       The number of read system calls per second executed over the monitoring interval.
                  Writes
                       The number of write system calls per second executed over the monitoring interval.
                  Forks
                       The number of fork system calls per second executed over the monitoring interval.
                  Execs
                       The number of exec system calls per second executed over the monitoring interval.
                  Runqueue
                       The average number of threads that were ready to run but were waiting for a processor to become available.
                  Waitqueue
                       The average number of threads that were waiting for paging to complete.
           FILE/TTY
                Displays the per-second frequency of selected file and tty statistics.
                  Readch
                       The number of bytes read per second through the read system call over the monitoring interval.
                  Writech
                       The number of bytes written per second through the write system call over the monitoring interval.
                  Rawin
                       The number of raw bytes read per second from TTYs over the monitoring interval.
                  Ttyout
                       The number of bytes written to TTYs per second over the monitoring interval.
                  Igets
                       The number of calls per second to the inode lookup routines over the monitoring interval.
                  Namei
                       The number of calls per second to the pathname lookup routines over the monitoring interval.
                  Dirblk
                       The number of directory blocks scanned per second by the directory search routine over the monitoring interval.
           PAGING
                Displays the per-second frequency of paging statistics.
                  Faults
                       Total number of page faults taken per second over the monitoring interval. This includes page faults that do not cause paging activity.
                  Steals
                       Physical memory 4K frames stolen per second by the virtual memory manager over the monitoring interval.
                  PgspIn
                       Number of 4K pages read from paging space per second over the monitoring interval.
                  PgspOut
                       Number of 4K pages written to paging space per second over the monitoring interval.
                  PageIn
                       Number of 4 K pages read per second over the monitoring interval. This includes paging activity associated with reading from file
                       systems. Subtract PgspIn from this value to get the number of 4K pages read from file systems per second over the monitoring interval.
                  PageOut
                       Number of 4K pages written per second over the monitoring interval. This includes paging activity associated with writing to file
                       systems. Subtract PgspOut from this value to get the number of 4K pages written to file systems per second over the monitoring interval.
                  Sios
                       The number of I/O requests per second issued by the virtual memory manager over the monitoring interval.
           MEMORY
                Displays the real memory size and the distribution of memory in use.
                  Real,MB
                       The size of real memory in megabytes.
                  % Comp
                       The percentage of real memory currently allocated to computational page frames. Computational page frames are generally those that are
                       backed by paging space.
                  % Noncomp
                       The percentage of real memory currently allocated to non-computational frames. Non-computational page frames are generally those that
                       are backed by file space, either data files, executable files, or shared library files.
                  % Client
                       The percentage of real memory currently allocated to cache remotely mounted files.
           PAGING SPACE
                Display size and use of paging space.
                  Size,MB
                       The sum of all paging spaces on the system, in megabytes.
                  % Used
                       The percentage of total paging space currently in use.
                  % Free
                       The percentage of total paging space currently free.
           NFS
                Display NFS stats in calls per second
                  *    Server V2 calls/sec
                  *    Client V2 calls/sec
                  *    Server V3 calls/sec
                  *    Client V3 calls/sec
           The variable part of the topas display can have one, two, three, four, or five subsections. If more than one subsection displays, they are always
           shown in the following order:
           *    Processor
           *    Network Interfaces
           *    Physical Disks
           *    Workload Manager Classes
           *    Processes
           When the topas command is started, it displays all subsections for which hot entities are monitored. The exception to this is the Workload Manager
           (WLM) Classes subsection, which is displayed only when WLM is active.
           CPU Utilization
                This subsection displays a bar chart showing cumulative processor usage. If more than one processor exists, a list of processors can be
                displayed by pressing the c key twice. Pressing the c key only once will turn this subsection off. The following fields are displayed by both
                formats:
                  User%
                       This shows the percent of processor used by programs executing in user mode. (Default sorted by User%)
                  Kern%
                       This shows the percent of processor used by programs executing in kernel mode.
                  Wait%
                       This shows the percent of time spent waiting for IO.
                  Idle%
                       This shows the percent of time the processor(s) is idle.
                  Physc
                       Number of physical processors consumed. Displayed only if the partition is running with shared processor.
                  %Entc
                       Percentage of entitled capacity consumed. Displayed only if the partition is running with shared processor.
                When this subsection first displays the list of hot processors, the list is sorted by the User% field. However, the list can be sorted by the
                other fields by moving the cursor to the top of the desired column.
           Network Interfaces
                This subsection displays a list of hot network interfaces. The maximum number of interfaces displayed is the number of hot interfaces being
                monitored, as specified with the -n flag. A smaller number of interfaces will be displayed if other subsections are also being displayed.
                Pressing the n key turns off this subsection. Pressing the n key again shows a one-line report summary of the activity for all network
                interfaces. Both reports display the following fields:
                  Interf
                       The name of the network interface.
                  KBPS
                       The total throughput in megabytes per second over the monitoring interval. This field is the sum of kilobytes received and kilobytes
                       sent per second.
                  I-Pack
                       The number of data packets received per second over the monitoring interval.
                  O-Pack
                       The number of data packets sent per second over the monitoring interval.
                  KB-In
                       The number of kilobytes received per second over the monitoring interval.
                  KB-Out
                       The number of kilobytes sent per second over the monitoring interval.
                When this subsection first displays the list of hot network interfaces, the list is sorted by the KBPS field. However, the list can be sorted
                by the other fields by moving the cursor to the top of the desired column. Sorting is only valid for up to 16 network adapters.
           Physical Disks
                This subsection displays a list of hot physical disks. The maximum number of physical disks displayed is the number of hot physical disks being
                monitored as specified with the -d flag. A smaller number of physical disks will be displayed if other subsections are also being displayed.
                Pressing the d key turns off this subsection. Pressing the d key again shows a one-line report summary of the activity for all physical disks.
                Both reports display the following fields:
                  Disk
                       The name of the physical disk.
                  Busy%
                       Indicates the percentage of time the physical disk was active (bandwidth use for the drive).
                  KBPS
                       The number of kilobytes read and written per second over the monitoring interval. This field is the sum of KB-Read and KB-Read.
                  TPS
                       The number of transfers per second that were issued to the physical disk. A transfer is an I/O request to the physical disk. Multiple
                       logical requests can be combined into a single I/O request to the disk. A transfer is of indeterminate size.
                  KB-Read
                       The number of kilobytes read per second from the physical disk.
                  K -Writ
                       The number of kilobytes written per second to the physical disk.
                When this subsection first displays the list of hot physical disks, the list is sorted by the KBPS field. However, the list can be sorted by
                the other fields by moving the cursor to the top of the desired column. Sorting is only valid for up to 128 physical disks.
           WLM Classes
                This subsection displays a list of hot Workload Manager (WLM) Classes. The maximum number of WLM classes displayed is the number of hot WLM
                classes being monitored as specified with the -w flag. A smaller number of classes will be displayed if other subsections are also being
                displayed. Pressing the w key turns off this subsection. The following fields are displayed for each class:
                  % CPU Utilization
                       The average processor use of the WLM class over the monitoring interval.
                  % Mem Utilization
                       The average memory use of the WLM class over the monitoring interval.
                  % Blk I/O
                       The average percent of block I/O of the WLM class over the monitoring interval.
                When this subsection first displays the list of hot WLM classes, the list will be sorted by the CPU% field. However, the list can be sorted by
                the other fields by moving the cursor to the top of the desired column.
           Processes
                This subsection displays a list of hot processes. The maximum number of processes displayed is the number of hot processes being monitored as
                specified with the -p flag. A smaller number of processes will be displayed if other subsections are also being displayed. Pressing the p key
                turns off this subsection. The processes are sorted by their processor usage over the monitoring interval. The following fields are displayed
                for each process:
                  Name
                       The name of the executable program executing in the process. The name is stripped of any pathname and argument information and truncated
                       to 9 characters in length.
                  Process ID
                       The process ID of the process.
                  % CPU Utilization
                       The average processor use of the process over the monitoring interval. The first time a process is shown, this value is the average
                       processor use over the lifetime of the process.
                  Paging Space Used
                       The size of the paging space allocated to this process. This can be considered an expression of the footprint of the process but does
                       not include the memory used to keep the executable program and any shared libraries it may depend on.
                  Process Owner (if the WLM section is off)
                       The user name of the user who owns the process.
                  Workload Manager (WLM) Class (if the WLM section is on)
                       The WLM class to which the process belongs.
    
  4. User%:显示运行的用户程序所占用的CPU百分比;
    Kern%:显示运行的内核程序所占用的CPU百分比;
    这里一只都有个误解.
    不是用户和内核程序,而是进程所执行的内核态 用户态的状态占用的CPU.深入理解得了解什么是CPU的用户态和内核态.
    Us
    The percentage of the processor used by programs executing in user mode.
    Sy
    The percentage of the processor used by programs executing in kernel mode.

  5. User%:显示运行的用户程序所占用的CPU百分比;
    Kern%:显示运行的内核程序所占用的CPU百分比;
    这里一只都有个误解.
    不是用户和内核程序,而是进程所执行的内核态 用户态的状态占用的CPU.深入理解得了解什么是CPU的用户态和内核态.Us The percentage of the processor used by programs executing in user mode.Sy The percentage of the processor used by programs executing in kernel mode.

    谢谢 指正

发表评论

邮箱地址不会被公开。 必填项已用*标注

3 × 3 =