pistat 查看进程状态

pidstat命令用于监视当前正在由Linux内核管理的各个任务。对于使用选项-p选择的每个任务,或者如果使用了选项-p ALL,它将写入Linux内核管理的 每个任务的标准输出活动不选择任何任务等同于指定-p ALL,但是报告中仅显示活动任务(统计值非零的任务)。

 pidstat -t  -p 17701 
Linux 3.10.0-957.5.1.el7.x86_64 (monitor.ipalfish-internal.com) 	09/26/2019 	_x86_64_	(16 CPU)

11:20:00 AM   UID      TGID       TID    %usr %system  %guest    %CPU   CPU  Command
11:20:00 AM     0     17701         -   36.42    1.27    0.00   37.69     3  prometheus
11:20:00 AM     0         -     17701    0.95    0.03    0.00    0.97     3  |__prometheus
11:20:00 AM     0         -     17702    0.10    0.53    0.00    0.63     9  |__prometheus
11:20:00 AM     0         -     17703    0.00    0.00    0.00    0.00     1  |__prometheus
11:20:00 AM     0         -     17704    0.00    0.00    0.00    0.00    15  |__prometheus
11:20:00 AM     0         -     17705    1.00    0.03    0.00    1.03    14  |__prometheus
11:20:00 AM     0         -     17706    0.97    0.03    0.00    1.00     4  |__prometheus

显示进程的线程使用 cpu 情况   %CPU  =  %system + %usr

  

$ pidstat -d -p 17701 
Linux 3.10.0-957.5.1.el7.x86_64 (monitor.ipalfish-internal.com) 	09/26/2019 	_x86_64_	(16 CPU)

11:16:43 AM   UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
11:16:43 AM     0     17701      0.00      0.00      0.00  prometheus


查看对应 pid 的磁盘使用情况

  

原文地址:https://www.cnblogs.com/leleyao/p/11589944.html