How to prevent memory exhaustion while using Apache Keep Alive?

P

postcd

Guest
Hello,

my virtual openvz VPS server crashed and there was sign it was exhausted memory. I have Keep Alive enabled.

Any advices on how to prevent memory over use because of example http attack with many connections?
 


I think you should try to limit the number of running processes of Apache (the options depend from used Apache concurrency model) and play with timeouts.

For example, I set the following values on my VPS:
Timeout 15
MaxKeepAliveRequests 30
KeepAliveTimeOut 3
StartServers 1
MinSpareServers 1
MaxSpareServers 2
MaxClients 10
MaxRequestsPerChild 100

In my case the most important are:
1. MaxClients that limit the number of child Apache processes
2. MaxRequestsPerChild that doesn't allow to grow to Apache's memory consumption

But I don't have a lot of connections simultaneously :) My site works for personal usage only. So you should set values according your requirements. Try to monitor how growing the number of running Apaches and memory consumption on your VPS in depend from the number of visitors.
 
nice suggestions.... yup limiting maxclients do work...
 

Members online


Top