Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache spawns multiple processes

Status
Not open for further replies.

Greenster

Programmer
Jan 14, 2002
30
GB
Please help,

My server was running along fine then one day I couldn't get to the domain, did a "ps-ef" and noticed that there was 10 or so httpd processes. I killed them all (except apache) and re-accessed the page and hey presto 8 processes had appeared (I don't exactly have a traffic problem). I kill them all again - re-access the page and 8 httpd processes appear all with identical time. Is this something I have done wrong? Any of this ring a bell with anyone?

Thx {Greenser}
 
Hi,









This is by design. On linux / unix, for security reasons only root or an init process can bind to a privileged port < 1024. So apache starts as user 'root' to bind to port 80 and then spawns a number of listeners which run as non-root processes for security purposes. So, with this design you need at least one listener. Why more ? Performance - the more listeners (each with multiple threads) the more simultaneous traffic can be handled.









The defaults in httpd.conf include :









StartServers 8








MinSpareServers 5








User apache











That means start 8 listeners (total 9 processes - root httpd process + 8 servers) and have a minimum of 5 idle listeners at all times (dynamically creating new listeners as necessary). The 'User' directive controls which non-root account the listeners run as (usually 'apache' or 'nobody').







There are lots of other related directives but, unless you have low traffic and are trying to save memory, I wouldn't recommend changing the defaults.







Hope this helps







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top