Thursday, February 23, 2017

What is D state process and how to check ? And what is the impact of it ?



To check the d state prcoess

#ps axl | awk '$10 ~ /D/'
#ps -aux

D state occurs when  the process is in uninterruptible sleep. This state is bad, because you can't do anything with the process in D state. Fortunately, process normally remains in such state not for so long. But if you have a heap of D state processes then some logic in system is disrupt. If that is happening, the very important thing is to determine where this unlucky sleep occurs. It is easy to do with ps command with l option. WCHAN column shows the name of the kernel function where the process is sleeping:


State D means uninterruptible sleep, which usually means IO. When the IO completes the process will change state.  If you think a specific process is hung you can truss or strace it to see what it is doing. i.e.

strace -p <pid of process>

If it does nothing for a long time it is more than likely stuck.


It may nothing to do with which disk folder.

The D state process effect cpu/processor scheduling.
Theoretically, D state still occupying cpu/processor resources.
So if too many D state processes, the cpus are busy on scheduling and re-scheduling (that is why we see high system load).

So the result could be unpredictable.



How to clear D-state process ?

D-state process is nothing but uninterruptible sleep. When doing IO, the process is locked as uninterruptible so the data will not be corrupted. When IO finished, the process will not be D-sate
But for some reason the IO could not be finished or hung, then the process may stick in D. in this cases we need to reboot the server to clear  D-state process.

9 comments:

  1. Thanks a lot for this useful post. Keep Sharing this kind of information.

    Linux Course in Chennai | Linux Training in Chennai

    ReplyDelete
  2. Very informative article, Which you have shared here about the D state process. After reading your article I got very much information and it resolved many of my doubts. If anyone interested to know more about the PS Command in Linux, Visit linoxide

    ReplyDelete
  3. This is an excellent tip especially to those new to the blogosphere. Short however exact data… Thank you for sharing this one. An unquestionable requirement read live post!

    ReplyDelete
  4. Adobe XD 54.0.12 Crack is a powerful, collaborative, and easy-to-use platform that helps you and your team create designs for websites. Adobe Experience Design CC Crack

    ReplyDelete
  5. No worries if you have failed in love think that he or she wasn't the right person for you. Love your life and love yourself. Love Failure Quotes

    ReplyDelete