We run Apache version 2.2.8-1ubuntu0.15
on our VPS instance of Ubuntu 8.04.4 LTS \n \l
, as I determined by asking this question.
When I issue pgrep apache2
, I get the following:
2691
24517
25330
25669
25672
25795
25796
25809
25825
26401
26402
That's 11 seperate instances of apache2
! Is this normal? If not, what should I do about it?
Yes. Apache works like a traditional unix daemon, whereby:
Forking does consume time, so Apache preforks several instances in anticipation of handling multiple requests. This is totally configurable via /etc/apache2.conf. I can't think of the exact directives right now, but it's probably explained in the comments.
If you expect to handle sudden bursts of concurrrent HTTP requests, then it benefits you to have a lot of instances standing by to take them. The tradeoff is this consumes more memory.
If you're looking to lower this number use the MinSpareServers and MaxSpareServers directives:
http://httpd.apache.org/docs/2.2/mod/prefork.html