I’ve noticed in the last few weeks that my VPS host this site runs on has been running out of guaranteed physical memory. This is the memory usage graph:
When this happens, many (but not all) of the sites served on this server stop responding to HTTP requests. A simple ‘ps’ command shows anywhere around 8-15 “apache2” processes each having approximately 40-50MB footprint in the system memory. Since I had not experienced this problem in the last 2 years prior to upgrading the apache2-mpm-prefork package on 3/17/09, I thought the mpm-prefork module might have something to do with this.
After reading Apache’s documentation on mpm-prefork and performance hints, I thought the mpm-worker module might work a bit better for my site. My curiosity, however, told me to stick with mpm-prefork for the time being and change MaxClients parameter from 150 down to 10.
I have been monitoring the server to see how this affects memory usage and overall performance. I have a feeling there is a bug in apache2-mpm-prefork 2.2.8-1ubuntu 0.5. Feedbacks are welcome.
Here’s a link to an interesting article about tuning apache’s configuration file:
Apache Performance Tuning.