Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

the server keeps crashing due to apache, is there any way i can stop this, the server has 2GB swap space and 3GB ram

May 25 03:33:41 server kernel: [ 3513.200719]  [<c015959c>] out_of_memory+0x14e/0x17f
May 25 03:33:41 server kernel: [ 3513.211491] Out of memory: kill process 2936 (apache2) score 87364 or a child
May 25 04:35:30 server kernel: [ 7239.936995]  [<c015959c>] out_of_memory+0x14e/0x17f
May 25 04:35:30 server kernel: [ 7239.948878] Out of memory: kill process 2936 (apache2) score 88236 or a child
May 25 05:42:57 server kernel: [11210.572510]  [<c015959c>] out_of_memory+0x14e/0x17f
May 25 08:13:23 server kernel: [    0.000000] PM: Registered nosave memory: 00000000000a0000 - 0000000000100000
share|improve this question
shouldn't you have swap size twice the size of your ram? – A.Rashad May 25 '10 at 9:59

Firstly, note that the OOM killer is simply killing Apache processes because it needs extra memory - it's not necessarily that Apache is the guilty party in consuming all the memory on the system.

That said, you should limit the number of Apache processes you allow to spawn. Your /etc/apache2/apache2.conf will have sections for Server-Pool Size Regulation (assuming you use the default MPM configuration); this will specify the maximum number of worker threads and processes Apache may grow to.

If the (MaxClients * memory per client) is larger than will fit in (physical memory - all other applications), it's too large. Most likely you've got it set for defaults that let Apache consume all the available memory, and the OOM killer comes to town.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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