良玉的博客 点点滴滴,积水成河_良玉的博客_页游、手游linux运维工程师之路

负载高排查异常进程状态

ps命令能打印出内存,cpu的情况但没办法打印出硬盘I/O的情况。虽然ps没办法打印出I/O的情况,但它可以显示出进程是否在等待I/O。


The ps state field provides the processes current state; below is a list of states from the man page.

ps状态列提供了进程当前的状态,以下从man ps上获取的进程stat列表


PROCESS STATE CODES

 D uninterruptible sleep (usually IO)

 R running or runnable (on run queue)

 S interruptible sleep (waiting for an event to complete)

 T stopped, either by a job control signal or because it is being traced.

 W paging (not valid since the 2.6.xx kernel)

 X dead (should never be seen)

 Z defunct ("zombie") process, terminated but not reaped by its parent.

 

等待I/O的进程通过处于uninterruptible sleep或D状态;通过给出这些信息我们就可以简单的查找出处在wait状态的进程


可以通过命令找出处于D状态的进程

top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D (I/O wait probably): "count}'


标签: 负载高top进程状态psD

作者:良玉 分类:Linux 浏览:268 评论:0
留言列表
发表评论
来宾的头像