Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do show the current list of processes and threads currently in the run queue?

That is to say, if my server's load average is 32.1, then there were on the average about 32 processes or threads ready to run at any given point in time over the past few minutes. I would like to find out what they are.

Something like ps axHr should do the trick, but on a server with a load average in the 80 range, it shows only 3 or 4 items.

The best I've come up with is ps axH | grep -v " S", but that seems kludgy and fragile, and not even totally correct.

share|improve this question
up vote 3 down vote accepted
ps -A -o pid,state,command | awk '{ if ($2 == "R") print }'
 1605 R /usr/bin/skype
30655 R ps -A -o pid,state,command

or use htop and sort(F6) by "S"

or to troubleshoot highload values:

while [ 1 ] ; do ps -A -o pid,state,command | \
   awk '{ if ($2 != "S") print }' | \
   grep -v "ps -A -o pid,state,command" ; sleep 3 ; done
share|improve this answer
Note that "R" isn't the only "running" state, many times they'll show up as "D", which still affects your load average – tylerl Sep 26 '10 at 9:01
@tylerl - why did you accept this if it doesn't correctly handle all the various states? – slm Dec 5 '14 at 20:58

You can add a watch to your command line :

 watch -n 1 "(ps aux | awk '\$8 ~ /D/ || \$8 ~ /R/   { print \$0 }')"
share|improve this answer
Or perhaps this: (ps aux | awk ' \$8 ~ /^[^S]/ { print \$0 }') – tylerl Jul 9 '15 at 16:49
Yes it seems more correct – mezgani Jul 10 '15 at 0:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.