Update 24th Oct
Dump of ps axl as requested by @David Schwartz : http://textuploader.com/?p=6&id=z8riS
During busy periods we hit Apache max connections (currently set to 256). I'd like to increase the max connections setting, but have been advised not to, due to our memory being over-committed during these periods. However, the actual RAM usage doesn't seem to be anywhere near the committed value.
How is the committed value calculated for Apache processes? And how can I reduce this?
I have already tried setting the PHP memory_limit to a lower value, but this has had no effect on the committed value in my munin graphs:
Server specs:
- DELL PowerEdge 2950 MKIII
- 8 GB RAM
- Single Socket Quad Core Intel Xeon 5320 LV 1.86GHz
- 2 x 146GB SFF 10K RPM Drive in RAID 1
- Apache/2.2.15 (Unix)
- PHP 5.3.3
The server is dedicated to Apache (MySQL is on another box).
I'd try to separate serving of PHP scripts and static files.
You can serve static files very efficiently with
worker MPM
and even better withevent MPM
available forhttpd 2.4+
. But you can not use this MPM for serving PHP scripts, as PHP isn't thread-safe.For PHP you can run a separate httpd instance (I'm running it on my server with
Listen 127.0.0.2:488
) and configure main server as a reverse proxy:With
mod_remoteip
(again - available from httpd 2.4) it would be truly transparent for a PHP script.Or use for example php-fpm.
This way request for static files, HTTP persistent connections etc. will use a fraction of RAM.