Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I am running a webserver with apache2 and ubuntu. Using ps I can see only a few apache processes running:

ps aux | grep apache

However if I htop, I can see loads of apache2 processes running. About 2 dozen. Why the difference?

share|improve this question
apache2 is a semi-threaded model vs. the original apache series. Top doesn't do threads, neither does ps - but htop does. – Avery Payne Nov 19 '09 at 18:49
up vote 15 down vote accepted

HTop is showing all the processes and their threads whereas ps aux only shows the processes. Press F5 in htop to create a hierarchal view of the processes and their threads. It will make more sense.

share|improve this answer

sweimann's answer is correct.

Additionally you can make ps(1) behave in the same way by using the H flag which will display threads as if they were processes.

Apparently the same key will also toggle off such behaviour in htop.

share|improve this answer

I don't know htop, but maybe it displays threads as separate processes and you have configured apache with a multithreaded worker?

share|improve this answer

In htop, you can disable this behavior by pressing F2, then go to "Display options", then mark "Hide userland threads". Optionally you may find "Hide kernel threads" useful too.

share|improve this answer

To highlight the difference between processes and threads in htop:

  1. press F2
  2. select "Display options"
  3. enable "Display threads in a different color"
share|improve this answer

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.