0

I am having trouble with my apache configuration. Right now nginx sits in front on apache as a reverse proxy, serving static assets and then passing php requests to apache. Apache is using mod_php. We do have users but the site is growing slowly, so i know for a fact Mysql is not the culprit here. The site is not database heavy it is web service heavy.

The site is slowly growing we will do about 430,000 uniques this month and can have anywhere from 80-230 people on it at a time, but requests per second never really go above 8.

Apache seems to hold onto memory, which after about a week causes the server to crash and reboot is required. The server is a linode 8 core, 8 GB ubuntu 12.04 machine.

This is the current config We use the Prefork module right now:

Timeout 15
KeepAlive Off
MaxKeepAliveRequests 1000
KeepAliveTimeout 5
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          256
    MaxRequestsPerChild   500
</IfModule>
HostnameLookups Off

If you need any more information let me know. Would we get less memory usage and better performance moving off the prefork module?

user1050544
  • 111
  • 5

1 Answers1

3

Regarding your capacity planning: How do you do load testing and capacity planning for web sites?

As for the memory leak, Apache should not be leaking memory if the children are properly terminating after 500 requests. It's possible that there is a nuance to your PHP code (and the libraries it depends on) that is causing the children to not terminate properly or consume excessive amounts of memory.

Try to locate processes that have memory usage or creation times significantly larger/further back in the past than the others. lsof -pPID may provide you a hint if you're lucky, but it's far more likely that you have some unfun debugging ahead of you.

(this is, of course, assuming that Apache is the culprit -- I'm taking it for granted that you have proven this somehow)

Andrew B
  • 31,858
  • 12
  • 90
  • 128
  • Load testing was done using Load Impact. We will soon be moving to a load balanced architecture, however this is probably a few months away. It could be php. I will need to dig further – user1050544 Apr 15 '14 at 14:20