Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jun 2005 17:04:07 +0100
From:      Thomas Hurst <tom.hurst@clara.net>
To:        David Banning <david+dated+1118931663.a557d5@skytracker.ca>
Cc:        questions@freebsd.org
Subject:   Re: httpd and memory usage
Message-ID:  <20050614160407.GA4819@voi.aagh.net>
In-Reply-To: <20050611142103.GA77709@skytracker.ca>
References:  <20050611142103.GA77709@skytracker.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
* David Banning (david+dated+1118931663.a557d5@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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050614160407.GA4819>