Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Mar 2003 07:30:06 -0500 
From:      "Haapanen, Tom" <tomh@metrics.com>
To:        "'freebsd-questions@freebsd.org'" <freebsd-questions@freebsd.org>
Subject:   Apache and shared memory
Message-ID:  <B1D77424948FD611A3B80000C0109EEFA09924@syncro.metrics.com>

next in thread | raw e-mail | index | archive | help
We are running a reasonably busy web site on FreeBSD (100K-200K hits per
day); we have split the database server (MySQL on FreeBSD 4.3) apart from
the web server  (Apache on FreeBSD 5.0 now).  Both running i386 versions
(Athlon CPUs).

Things generally work very well, but ongoing memory usage is a concern.  We
have to run both mod_perl and mod_php, and the resulting memory usage is in
the 10-20 MB range per httpd process.  (The mod_php seems especially leaky
with respect to memory.)  So on our 1 GB web server, it's pretty risky
running more than 50 httpd processes.

I keep reading about optimizing mod_perl shared memory, and yet it seems I
am missing an essential piece, as it looks like the system is not using
shared memory at all:

# ipcs -m             
Shared Memory:
T     ID     KEY        MODE       OWNER    GROUP
# sysctl -a | grep shm
kern.ipc.shmmax: 33554432
kern.ipc.shmmin: 1
kern.ipc.shmmni: 192
kern.ipc.shmseg: 128
kern.ipc.shmall: 8192
kern.ipc.shm_use_phys: 0
          shm     1    16K     16K        1  16384
#

This is running with the GENERIC kernel, which appears to have shared memory
enabled.  Using the precompiled Apache 1.3.27 port from freebsd.org.

So it appears that I somehow need to tell Apache that I want to use shared
memory, before I even try to optimize mod_perl.  And yet I can't find any
appropriate directives.

Can anyone suggest what I am missing?  I can only add another 512 MB to the
machine before the add-more-physical-memory approach runs out.

Thanks ...

Tom Haapanen
tomh@motorsport.com

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?B1D77424948FD611A3B80000C0109EEFA09924>