Re: MP2 + Apache2 Memory usage

[prev] [thread] [next] [Date index for 2004/12/15]

From: Perrin Harkins
Subject: Re: MP2 + Apache2 Memory usage
Date: 19:33 on 15 Dec 2004
On Wed, 2004-12-15 at 17:52 +0000, Gareth Harper wrote:
> Having tweaked mod_perl with some preloading and other things a pmap on 
> solaris shows our apache processes using 4-5Mb of private memory (mainly 
> heap), the full process size is around 20Mb.

Sorry to break it to you, Gareth, but that's pretty standard.  I usually
see about 5 MB of unshared memory per process on Linux.  I check how
much is shared by looking at top, which does take into account the
copy-on-write stuff on Linux.

> If anyone can give me any pointers how I might track all this info down, 
> or alternatively any good ways of reducing the memory usage any further, 
> I would be very grateful.

Most of the documentation on reducing memory usage is here:
http://perl.apache.org/docs/1.0/guide/performance.html

> The issue arises because we need to run up 
> to 800 apache process on each of our frontend webservers at peak times 
> (mainly to deal with slow connections)

You should handle these with a front-end proxy.  You will typically only
need a fairly small number of mod_perl processes to keep 800 apache
processes busy.  The front-end proxy (or reverse proxy) approach is also
documented in that same section.

> One other issue I had was that I can preload all of the modules in 
> startup.pl, however each module still retains the extra memory unless I 
> actually remove the uses/requires from the module which is using it.

That means something is wrong with your pre-loading.  It should not make
any difference at all if you have use/require stuff in your modules
after pre-loading them.

> ** Yes the obvious solution to this is to go with threaded

Actually, reports so far are that running mod_perl 2 with threaded MPMs
on Linux actually takes more memory because it breaks the copy-on-write
sharing.  Preforking is more efficient.

- Perrin


        -- 
        Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

MP2 + Apache2 Memory usage
Gareth Harper 17:52 on 15 Dec 2004

Re: MP2 + Apache2 Memory usage
Perrin Harkins 19:33 on 15 Dec 2004

Re: MP2 + Apache2 Memory usage
Stas Bekman 20:07 on 15 Dec 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52