Click to See Complete Forum and Search --> : Apache multiple instances
groundzero
01-31-2001, 03:13 PM
I just enable Apache on my fresh MD7.2 install. I did a ps -ef and saw many instances of httpd running. Is this normal?
------------------
Groundzer0......
Please stop me before I format again. (Im a Serial Formater)
Lorithar
01-31-2001, 06:27 PM
*grins*
One is the parent .. there will be (apache default install) five children started...if you get a number of hits on the server that occupies all running instances, it will start more ... they will stay running until there have been no requests for them to service for (again default install) about 5 minutes.
klamath
01-31-2001, 07:08 PM
if you get a number of hits on the server that occupies all running instances, it will start more
Actually, no -- if the number of spare (i.e. idle) server processes drops below MinSpareServers, it will start more, at a rate of 1 per second.
I'm writing my own HTTP daemon (see my sig), and I'm currently designing my own version of this process. It's fairly tricky to get it right...
------------------
- Klamath
Get my GnuPG Key Here (http://klamath.dyndns.org/mykey.asc)
Looking for an open source project to contribute to? Check out the Tornado HTTP Server (http://sourceforge.net/projects/tornado)
groundzero
02-01-2001, 03:25 AM
Thanks guys.....
Its all good.
------------------
Groundzer0......
Please stop me before I format again. (Im a Serial Formater)
Sweede
02-01-2001, 07:06 PM
A little more details...
The MaxClients is the maximum number of connections each child process can handle.
the maxservers is the maximum number of Child prossess the partent process will spawn.
by default, apache will be able to handle around 5*150 (750) requests at the same time. if it goes over that number,(800) it will spawn of a new child, and when the requests drop below the threshold, it kills off the servers until its at MinSpareServers
if you have StartServers set at 1, then MinSpareServers at like, 8, it will create 7 more child apache processes.
There is a problem with this though (a few actually).
1) it is a huge memory resource hog.
if you have your main domain, www.domain.com (http://www.domain.com) , and a sub-domain setup in a virtual host (like it should), a unique request to the sub-domain will start up a new child process.
if your like me and run an apache server and a lot of virtual domains with sub-domains, its not un-common to find a LOT of apache processes for each hit to a unique domain (one for domain.com, one for support.domain.com, one for cgi.domain.com, etc).
2). each child is the user specified in the httpd.conf. Real Threads (NT style) instead of this parent->child relationship will solve this (as it will in Apache 2.0).
(not corrected for correctness in spelling of directives to be correct)
Apache 2.0 comes out, all will be FAR better (plus php can run per user http://www.linuxnewbie.org/ubb/biggrin.gif ).