[Israel.pm] mod_perl preload module and shared memory help

Scott Weisman sweisman at pobox.com
Tue Jun 20 01:09:27 PDT 2006


I am running an Apache2/mod_perl2 program I have been working on for a
number of years. Early on, I added support to preload the modules I
use, in order to minimize the server footprint. I never really
examined the actual memory usage in depth before, but decided to
recently for various reasons. What I found was kind of surprising.

The size of each process is ~31MB. I don't know if this is unusually
large or not (although the sizes given in the examples on optimizing
memory usage in "Practical mod_perl" are much smaller), but the number
itself isn't a big concern, because I figured the processes must be
sharing lots of memory. I was wrong. Each process is sharing about
1.7MB of memory, which is MUCH lower than I expected. How is this even

Even stranger, when I disabled all module pre-loading (so that only
the Apache:: and APR:: modules I need are loaded), the memory
footprint (process size and shared memory) BARELY CHANGES! However,
when I don't load ANY modules, the process size FINALLY drops to 13MB,
 but even then, the shared memory is still only 1.2MB per process.

I would like to decrease the process size, if possible, but I am more
concerned with increasing the shared memory between processes. I have
followed all the tips I could find online.

These are the Apache modules I load:

use Apache2::Const -compile => qw(Apache2::Const::OK
use Apache2::Connection ();
use Apache2::RequestRec ();
use Apache2::RequestUtil ();
use Apache2::RequestIO ();
use Apache2::Request ();
use Apache2::Upload ();
use Apache2::Cookie ();
use APR::SockAddr ();

Does anyone have any suggestions?


Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote. - Benjamin Franklin

More information about the Perl mailing list