I’ve been running a new VPS instance for the last few months and started getting some weird Passenger errors. On further research, it looked like passenger was hitting out of memory conditions and unable to spawn a new worker. After looking at the running process, I saw that apache was spawning more than 10 processes over time, and they were eating up all the memory for my vps.
So an easy solution was to reduce the number of child process servers Apache can spawn. In your httpd.conf file, simply edit down the number of MinSpareServers and StartServers to something your system can handle. In my case, the relevant lines look like this:
<IfModule prefork.c> StartServers 1 MinSpareServers 1 MaxSpareServers 5 MaxClients 256 MaxRequestsPerChild 4000 </IfModule>

0 Responses to “Tuning Apache Instances”