atop备忘

atop 安装

sudo apt install atop

atop 参数说明

这里写图片描述

监控界面字段说明

ATOP列:该列显示了主机名、信息采样日期和时间点

PRC列:该列显示进程整体运行情况

sys、usr字段分别指示进程在内核态和用户态的运行时间
#proc字段指示进程总数
#zombie字段指示僵死进程的数量
#exit字段指示atop采样周期期间退出的进程数量

CPU列:该列显示CPU整体(即多核CPU作为一个整体CPU资源)的使用情况,我们知道CPU可被用于执行进程、处理中断,也可处于空闲状态(空闲状态分两种,一种是活动进程等待磁盘IO导致CPU空闲,另一种是完全空闲)

sys、usr字段指示CPU被用于处理进程时,进程在内核态、用户态所占CPU的时间比例
irq字段指示CPU被用于处理中断的时间比例
idle字段指示CPU处在完全空闲状态的时间比例
wait字段指示CPU处在“进程等待磁盘IO导致CPU空闲”状态的时间比例

CPU列各个字段指示值相加结果为N00%,其中N为cpu核数。

cpu列:该列显示某一核cpu的使用情况,各字段含义可参照CPU列,各字段值相加结果为100%

CPL列:该列显示CPU负载情况

avg1、avg5和avg15字段:过去1分钟、5分钟和15分钟内运行队列中的平均进程数量
csw字段指示上下文交换次数
intr字段指示中断发生次数

MEM列:该列指示内存的使用情况

tot字段指示物理内存总量
free字段指示空闲内存的大小
cache字段指示用于页缓存的内存大小
buff字段指示用于文件缓存的内存大小
slab字段指示系统内核占用的内存大小

SWP列:该列指示交换空间的使用情况

tot字段指示交换区总量
free字段指示空闲交换空间大小

PAG列:该列指示虚拟内存分页情况

swin、swout字段:换入和换出内存页数

DSK列:该列指示磁盘使用情况,每一个磁盘设备对应一列,如果有sdb设备,那么增多一列DSK信息

sda字段:磁盘设备标识
busy字段:磁盘忙时比例
read、write字段:读、写请求数量

NET列:多列NET展示了网络状况,包括传输层(TCP和UDP)、IP层以及各活动的网口信息

XXXi  字段指示各层或活动网口收包数目
XXXo 字段指示各层或活动网口发包数目

试图模式 及 对应按键

g 普通模式

这里写图片描述

    PID:为进程id 
    SYSCPU: 内核模式下占用了CPU时间
    USRCPU: 用户模式下占用了CPU时间
    ACPU: 相对10秒采样周期,CPU时间占用比例
    ST:表示进程状态,N表示该进程是前一个采样周期新生成的进程,E表示该进程已退出
    EXC: 指示进程的退出码。从进程名在“<>”符号中,我们亦可知该进程已退出
    THR: 进程拥有的线程数
    CMD: 进程启动命令
    VGROW: 虚拟内存增加大小
    RGROW: 实际内存增加大小
    RUID: 用于在系统中标识一个用户是谁,当用户使用用户名和密码成功登录后一个UNIX系统后就唯一确定了他的RUID.
    EUID: 用于系统决定用户对系统资源的访问权限,通常情况下等于RUID。
    SUID: 用于对外权限的开放。跟RUID及EUID是用一个用户绑定不同,它是跟文件而不是跟用户绑定。

m 内存模式

这里写图片描述

    MINFLT: 每秒次缺页错误次数(minor page faults),次缺页错误次数意即虚拟内存地址映射成物理内存地址产生的page fault次数
    MAJFLT: 每秒主缺页错误次数(major page faults),当虚拟内存地址映射成物理内存地址时,相应的page在swap中,这样的page fault为major page fault,一般在内存使用紧张时产生
    VSTEXT: The virtual memory size used by the shared text of this process

c 命令模式

这里写图片描述

d 磁盘视图

这里写图片描述

    RDDSK:过去10S进程读磁盘的数据量
    WRDSK:过去10S进程写磁盘的数据量
    WCANCL:The write data transfer previously accounted for this process or another pro
    DSK:过去10S进程所占磁盘的百分比

p 进程视图

这里写图片描述

    NPROCS: The number of active and terminated processes accumulated  for this user or program.
    RNET: The number of TCP- and UDP packets received by  this  process.
    SNET: The number  of  TCP-  and  UDP  packets  transmitted  by  this process. 

u 用户视图

这里写图片描述

基于文件查看

atop -r file
b 指定时间
t 前进翻页
T 后退翻页
进程列表前进翻页: ctrl + f
进程列表后退翻页: ctrl + b

atopsar

Usage: atopsar [-flags] [-r file|date] [-R cnt] [-b hh:mm] [-e hh:mm]
        or
Usage: atopsar [-flags] interval [samples]

    Today's atop logfile is used by default!

    Generic flags:
      -r  read statistical data from specific atop logfile
          (pathname, or date in format YYYYMMDD, or y[y..])
      -R  summarize <cnt> samples into one sample
      -b  begin  showing data from  specified time
      -e  finish showing data after specified time
      -S  print timestamp on every line in case of more resources
      -x  never  use colors to indicate overload (default: only if tty)
      -C  always use colors to indicate overload (default: only if tty)
      -M  use markers to indicate overload (* = critical, + = almost)
      -H  repeat report headers (in case of tty: depending on screen lines)
      -a  print all resources, even when inactive

    Specific flags to select reports:
      -A  print all available reports
      -c  cpu utilization
      -p  process(or) load
      -P  processes & threads
      -m  memory & swapspace
      -s  swap rate
      -l  logical volume activity
      -f  multiple device activity
      -d  disk activity
      -i  net-interf (general)
      -I  net-interf (errors)
      -w  ip   v4    (general)
      -W  ip   v4    (errors)
      -y  icmp v4    (general)
      -Y  icmp v4    (per type)
      -u  udp  v4
      -z  ip   v6    (general)
      -Z  ip   v6    (errors)
      -k  icmp v6    (general)
      -K  icmp v6    (per type)
      -U  udp  v6
      -t  tcp        (general)
      -T  tcp        (errors)
      -O  top-3 processes cpu
      -G  top-3 processes memory
      -D  top-3 processes disk
      -N  top-3 processes network

参考资料

atop官方
atop博客

猜你喜欢

转载自blog.csdn.net/chen8238065/article/details/77170846