httpd and memory usage
Thomas Hurst
tom.hurst at clara.net
Tue Jun 14 16:04:10 GMT 2005
* David Banning (david+dated+1118931663.a557d5 at skytracker.ca) wrote:
> I seem to have a lot of memory being eaten by httpd (part output of top);
> Any ideas to have httpd timeout sooner to preserve memory?
MaxRequestsPerChild is there to cope with leaks, it won't help if Apache
is using a lot of memory to start with though, but if you've got some
mod_php or mod_perl which leaks it can be handy.
Worker MPM uses threads and will probably share more memory than
prefork, not to mention require you to use fewer processes to handle a
given load.
Moving things like mod_php and mod_perl stuff to FastCGI avoids each
httpd having a copy of the interpreter and its various data structures
each, and segments the memory of the interpreters outside httpd so it's
easier to see what's using the memory; you'll have fewer copies running
too, since the static:dynamic request ratio isn't normally 1:1.
Commenting out unused modules in httpd.conf will save some memory.
You might also consider switching to something like lighttpd, which uses
a single process that's generally about 1/3 the size of an equivilent
httpd process.
--
Thomas 'Freaky' Hurst
http://hur.st/
More information about the freebsd-questions
mailing list