每日命令-pidstat

pidstat只显示正在使用资源的线程或进程
-d,显示磁盘使用情况

pidstat -d 2
12:16:55 PM PID kB_rd/s kB_wr/s kB_ccwr/s Command

12:16:57 PM PID kB_rd/s kB_wr/s kB_ccwr/s Command
12:16:59 PM 108040 0.00 2.00 0.00 oradba

12:16:59 PM PID kB_rd/s kB_wr/s kB_ccwr/s Command

12:17:01 PM PID kB_rd/s kB_wr/s kB_ccwr/s Command
          PID
                 The identification number of the task being monitored.

          kB_rd/s
                 Number of kilobytes the task has caused to be read from disk per second.

          kB_wr/s
                 Number of kilobytes the task has caused, or shall cause to be written to disk per second.

          kB_ccwr/s
                 Number of kilobytes whose writing to disk has been cancelled by the task. This may occur when the task truncates some dirty pagecache. In this case,
                 some IO which another task has been accounted for will not be happening.

          Command
                 The command name of the task.

-p { pid [,…] | SELF | ALL },指定要显示的进程或线程所属进程,SELF即输出pidstat进程本身的资源使用情况,而ALL则是所有正在使用资源的进程

pidstat -p 150643 2
12:21:04 PM PID %usr %system %guest %CPU CPU Command
12:21:06 PM 150643 0.00 0.00 0.00 0.00 30 zabbix_agentd-2
12:21:08 PM 150643 0.00 0.00 0.00 0.00 30 zabbix_agentd-2

-t,显示线程信息

pidstat -t -p 150643 2

12:22:23 PM TGID TID %usr %system %guest %CPU CPU Command
12:22:25 PM 150643 - 0.00 0.00 0.00 0.00 30 zabbix_agentd-2
12:22:25 PM - 150643 0.00 0.00 0.00 0.00 30 |__zabbix_agentd-2

12:22:25 PM TGID TID %usr %system %guest %CPU CPU Command
12:22:27 PM 150643 - 0.00 0.00 0.00 0.00 30 zabbix_agentd-2
12:22:27 PM - 150643 0.00 0.00 0.00 0.00 30 |__zabbix_agentd-2

-u,显示CPU系信息

pidstat -p -u 150643  2

12:23:31 PM PID %usr %system %guest %CPU CPU Command
12:23:33 PM 150643 0.00 0.00 0.00 0.00 30 zabbix_agentd-2
12:23:35 PM 150643 0.00 0.00 0.00 0.00 30 zabbix_agentd-2
12:23:37 PM 150643 0.00 0.00 0.00 0.00 30 zabbix_agentd-2

-w,显示上下文切换信息

pidstat -p 150643 -w 2

12:25:40 PM PID cswch/s nvcswch/s Command
12:25:42 PM 150643 0.00 0.00 zabbix_agentd-2
12:25:44 PM 150643 0.00 0.00 zabbix_agentd-2
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值