Why are 9 httpd processes running when I autostart httpd on boot?

Posted on

Why are 9 httpd processes running when I autostart httpd on boot? – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about apache-2.2, fedora, httpd, , .

A pgrep httpd yeilds 9 pids:

1624
1651
1652
1653
1654
1655
1656
1657
1658

If I kill the httpd process with the first pid( here 1624 ) all the httpd process gets killed.

Although if kill the processes with pid’s other than the first one, only that process gets killed. And as soon as the number of httpd processes gets lower than 6, It will spawn httpd processes and the number of httpd process is maintained at constant 6.

This does not happen when I manually start httpd. only one process getd created.

  • why is the above behaviour?
  • Is httpd getting started as thread based?

Also I am running httpd on Fedora 15 on a 6 core processor.

And I have not changed anything in /etc/sysconfig/httpd every line in /etc/sysconfig/httpd is commented.

Solution :

The behavior depends on which MPM you’re using, but yes, it’s expected; these are worker processes. Look for the StartServers directive in your configuration.

When you start httpd via the service or /etc/init.d/httpd, it reads /etc/sysconfig/httpd, if HTTPD is not changed, it starts the prefork model. When you are starting it by hand, you are probably starting the worker based model. If you look it /etc/httpd/conf/httpd.conf and look for prefork you will find the sections related to either model. StartServers says how many processes to load.

Leave a Reply

Your email address will not be published. Required fields are marked *