0

I run a little startup on a Cloud server with 512MB and monitor the CPU/memory consumption with htop and phpsysinfo. Once, the server has ran out of RAM and on some instance get as high as consuming close to 90% of RAM. htop shows apache (httpd) as the top process with some (httpd) process consuming up to 7.5% in some instance. Is this amount (7.5%) too much for a single httpd process? What are the recommendations for reducing apache memory consumption?

2
  • What kind of content is Apache serving? Static files or does it do any processing?
    – phuzion
    Jul 29, 2009 at 13:25
  • Sorry I failed to mention. The site runs on PHP, so Apache does processing. Besides, I have gzip compression turned on but I dont think this should have that big effect on the memory.
    – ray
    Jul 29, 2009 at 13:51

2 Answers 2

2

7.5% for a single child doesn't sound too abnormal, but it all depends on what the child is supposed to do... I run systems with apache and mod_perl and those children get huge.

Watch your apache children memory footprints over time to see if they stabilize. If not, use MaxRequestsPerChild to control how often they are restarted. Use MaxClients to limit how many concurrent children you have (to avoid swap or out of virtual memory issues).

In my experience, it's generally a memory bottleneck on the webservers.

0

That sounds pretty normal. To reduce the memory footprint would be to figure out which modules you need and don't need and compile your own version. Although with dynamic modules maybe that doesn't help as much.

Here is a nice O'Reilly article about getting your Apache memory requirements down. Although a bit old, not sure if has the enhancements that come with Apache 2.

You must log in to answer this question.