Skip site navigation (1)Skip section navigation (2)
Date:      Sun,  2 Mar 2003 07:11:12 -0800 (PST)
From:      Mike Harding <mvh@ix.netcom.com>
To:        freebsd-questions@freebsd.org
Cc:        tom@motorsport.com
Subject:   Re: Apache and shared memory
Message-ID:  <20030302151112.27D475296@netcom1.netcom.com>

next in thread | raw e-mail | index | archive | help

When people talk about optimizing mod_perl shared memory, they are not
referring to System V type shared memory as seen by ipcs.  They are
talking about memory shared by virtue of a process fork - this is
effectively read only memory.  The net effect is that a process may
appear to be 20 meg, but may only use 2 or 3 meg, say.

It has been difficult to monitor 'unshared' memory use in FreeBSD as
freebsd has traditionally reported via getrusage() as an 'integrated'
unshared memory use which is more related to the old school process
accounting than it is to the actual unshared memory use - this may
have changed in -CURRENT or recent -STABLEs.  Linux reports the
unshared memory directly via gtop which is a lot more convenient.  I
wish (hint hint) that there was a sysctl to handle this...

There are other tricks you can do to maximize memory use, such as
putting the php and perl servers, and image servers on separate apache
processes, and proxying between them, rather than running php and
mod_perl on the same server, and adjusting the (Min/Max)SpareServers
to reap apache process during quieter times.

The main thing to do with mod_perl is to pre-load all of the perl
modules during apache startup so that the modules are shared rather
than being loaded separately into each apache process.
http://perl.apache.org has some excellent documentation about this.
Also Apache::SizeLimit can be useful for mod_perl based systems.

Tuning apache can be a lot of... fun!

Hope this helps,

- Mike H.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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