On Wed, 12 Mar 1997, Ricardo Galli wrote:
> Apache does a fork for every conection, apart of being slower with a high
> load (because there is not enough time for preforking), it consumes a lot
> of memory and CPU.
Sorry this is entirely wrong. Apache preforks children (starting with
the value set by StartServers). It then monitors how many children are
busy and ensures that there are always at least MinSpareServers and at
most MinSpareServers idle waiting for requests. Each child can handle at
most MaxRequestsPerChild requests (or "infinite" if you set that to 0).
So no, it definately does *not* fork for each request.
Furthermore, if you're just doing a "ps | grep httpd" and counting up
the SZ fields then you're misleading yourself as to the real memory
consumed by apache. That is, unless you're on an extremely lame Unix.
The text segments of all those httpds are shared. Plus all modern Unixes
implement copy-on-write fork semantics. That is, when the fork occurs
no memory is allocated for the child. Only when the child or the parent
actually write to a piece of memory is that memory copied for each pid.
So the end result is that all of the static, common data between all
the children is shared.
Apache is generally not as fast/efficient as a well implemented
multithreaded server can be. But it generally is far faster than most
people need to fill a half dozen T1s. (All depending on your
hardware of course.)
But yes, as a pure proxy cache Apache is nowhere near the performance of
squid. But if you want to run a hybrid proxy/server it's very versatile.
Dean
Received on Thu Mar 13 1997 - 11:48:37 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:34:41 MST