3 ms·
I have nothing but good things to say about Slicehost. That said, 256 is a very small sandbox and Apache doesn't play nicely in small sandboxes without tweaking
by Todd 19y ago
I have nothing but good things to say about Slicehost. That said, 256 is a very small sandbox and Apache doesn't play nicely in small sandboxes without tweaking. Our site runs several PHP apps.
We hit the wall one day with a number of apache2 processes hitting the 60-80MB range. I could barely SSH in to fix things.
We ended up arriving empirically at the following (taken from /etc/apache2/apache2.conf), without stress testing, but watching patterns over several weeks.
<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 3
MaxSpareServers 6
# MaxClients 150
MaxClients 10
# MaxRequestsPerChild 0
MaxRequestsPerChild 200
</IfModule>
The key is to take MaxClients down to a small number, like 8-10, as each of these normally takes anywhere from 2-40MB. To make this work, you'll need to have the request count set reasonably small. We set ours to 200, so RAM consumption doesn't get too large before the process is cycled. People often suggest 4000 or some such number but the process just grew too large with that setting. You'll also note that we have tuned the startup and idle parameters to be very conservative.
This is probably a laughable configuration for many sites, but it works well for a light site like ours running a few PHP apps. I should note that we're also running MySQL and PostgreSQL. They don't have a big impact on RAM under light load.