hegu 发表于 2014-07-25 16:45

请问进程有关D状态。


我服务器的nginx进程很多是D状态:但是系统的cpu不高,才10%左右。
现在很多d状态导致用户连接进程超时。
请问有什么办法能查nginx是阻塞在什么地方?谢谢了。
用strace查,发现主要的操作都在sendfile:
% time   secondsusecs/call   calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
81.29    0.003614          48      76         sendfile
11.13    0.000495          10      50         readv
4.05    0.000180         2      89         writev
3.53    0.000157         5      30         close
0.00    0.000000         0      11         write
0.00    0.000000         0         5         open
0.00    0.000000         0         6         2 stat
0.00    0.000000         0         5         fstat
0.00    0.000000         0         3         ioctl
0.00    0.000000         0      10         socket
0.00    0.000000         0         3         accept
0.00    0.000000         0      12         sendto
0.00    0.000000         0      24      12 recvfrom
0.00    0.000000         0         2         shutdown
0.00    0.000000         0         7         getsockname
0.00    0.000000         0      14         setsockopt
0.00    0.000000         0         2         getsockopt
0.00    0.000000         0         2         epoll_wait
0.00    0.000000         0         4         epoll_ctl
------ ----------- ----------- --------- --------- ----------------
100.00    0.004446                   355      14 total

nginx状态:
root   108395.71.1 153144 91428 ?      S    15:10   3:34 nginx: work
er process
root   108406.01.0 140676 82612 ?      S    15:10   3:44 nginx: work
er process
root   108415.71.0 144412 86080 ?      D    15:10   3:34 nginx: work
er process
root   108425.80.9 135428 77112 ?      S    15:10   3:37 nginx: work
er process
root   108435.91.0 145780 83380 ?      D    15:10   3:43 nginx: work
er process
root   118181.21.9 332380 159448 ?       D    15:14   0:43 nginx: work
er process
root   118191.22.0 339788 166888 ?       D    15:14   0:44 nginx: work
er process
root   118201.21.9 331148 156104 ?       D    15:14   0:42 nginx: work
er process
root   118211.31.9 331448 156388 ?       D    15:14   0:46 nginx: work
er process
root   118221.41.9 335668 162712 ?       D    15:14   0:50 nginx: work
er process
root   118231.31.9 336032 163148 ?       D    15:14   0:48 nginx: work
er process
root   118241.31.9 329228 156328 ?       D    15:14   0:47 nginx: work
er process
root   118251.31.9 332944 160024 ?       D    15:14   0:45 nginx: work
er process

hegu 发表于 2014-07-25 19:45

有人知道吗?

自己顶一下,谢谢了。

action08 发表于 2014-07-27 19:20

sendfile在做什么啊,bug的可能大些,估计应该不是被黑了
页: [1]
查看完整版本: 请问进程有关D状态。