I am currently having very severe problems with my Linux CentOS dedicated server. For some peculiar reason, all of my memory is being consumed by apache and resultantly, my qmail process is crashing.

Firstly, why would qmail crash if apache is eating all of the memory?

How can I get to the bottom of what is causing this issue? I am being helped by the support team at Media Temple, but this is out of their scope of support so I am unsure of what else they can help me with.

I am really quite confused with this as it there seems to be no logical explanation for why the memory is being used up. I am not receiving any more traffic on my websites than usual

To give you a little info on the situation:

  1. It seems that all of this started when I updated Plesk and my container. However, I cannot be certain about this and it is likely I did other things on the same date to
  2. When I look at the beancounters, it says that there is a failcnt of 547225 in the tcpsndbuf. I do not know what this means but this is the reason for me believing the problem is with Apache. Can I research into this futher?
  3. Although probably irrelevant, a few weeks ago I used the Apache Benchmarking tool to simulate 1000 visits to one of my websites.
  4. A few weeks ago I also followed the Media Temple 'Making it better steps' to install Monit, Munin, Plesk Health Monitor and general Apache and MySQL tuning. These steps have undoubtedly had a reverse effect on the server as since then, my memory consumption has been much higher. I tried to revert to the previous conf files but this did not make a difference.

I have spent ages trying to get to the bottom of this but I think the issue is a little too advanced for me. Does any body have any advice?


I forgot to mention that every now and again, my CPU spikes. Not sure if that is relevant but thought I would include it.

  • How much memory do you have? The OOM Killer may be "crashing" qmail. More: stackoverflow.com/questions/624857/… – HTTP500 Feb 5 '12 at 19:58
  • I had 512MB but have just upgraded to 1GB – Ben Carey Feb 5 '12 at 20:15
  • Couldnt find any killed processes using the link you supplied. I am looking into the apache maxChildRequests – Ben Carey Feb 5 '12 at 20:29

Qmail may crash if Apache holds all available memory and Qmail attempts to fork, which would fail to allocate the necessary memory. This could cause the parent process to die as well.

From what I've seen in the past (And this may not hold true in your case) high memory utilization in Apache may also come from PHP or CGI scripts that Apache runs. Check the max memory usage in your php.ini to see if it is set to sane value. Keep in mind that (so far as I recall) a max of 64MB in php.ini is 64MB per executing script, so if you have 10 Apache threads that each run a script that uses the maximum memory, it could cause issues.

There are some other serverfault posts that have some good information in them here:

Heavy Apache memory usage

Apache memory issues

Apache and Memory issues

  • Thank you for your reply. My memory limit is set to 128MB which could very easily use up all the memory available pretty quickly. However, I am not aware of any PHP scripts that would use this sort of memory, especially on such a regular basis. In addition, my server is not running out of memory so why cant qmail just take the memory from there as opposed to going through apache? – Ben Carey Feb 5 '12 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.