Httpd – Apache “httpd” process, utilizing all the servers memory

apache-2.2httpdlampmemorymemory usage

My small ec2 instance with 1.7 GB memory, running the Amazon AMI based off of CentOS, has an issue with Apache utilizing way too much memory than it should. If you take a look at the screenshot, the memory usage will be at 90-100% until I reboot the httpd service, where it will start over, increasing its way back up to 90+ %.

enter image description here

I would really appreciate some assistance on how to locate the issue. Is this perhaps "normal" apache behavior, to utilize all available memory? Or is there a possible leak I have to hunt down. At the moment I'm a bit perplexed as to what could be going on.

We are using the Apache MPM prefork, and no sql or anything similar – just apache. The website is here.

Best Answer

As HTTP500 said, you probably shouldn't worry about it unless the machine is actually choking. Take a look at Help! Linux Ate My RAM!. It's not quite an analogous situation, as you have processes rather than buffers using up the RAM, but it's not too far off: your machine's physical RAM is a resource to be used, either with kernel buffers or spare Apache worker processes to promptly handle incoming requests. If you're not using RAM, you've overpaid for the size of your box.

Anyway, if you want to play with MPM settings, the Apache documentation is http://httpd.apache.org/docs/current/mod/prefork.html

You can perhaps reduce the MinSpareServers, StartServers, etc., as you've stated that the site is low traffic. You will then have more free RAM to be consumed by kernel buffers for their nefarious purposes.