Found this on the internet for slice VSs. Though owned by rackspace now, still a helpful forum. This works great for a 256Mb slice. I have it on a 512Mb and there it rocks as well. I will likely tweak further for the 512Mb. Regardless the anecdotal evidence was spot on for both situations.
WHAT I DID
vi /etc/apache2/apache2.conf # and make it so
[...] KeepAliveTimeout 5 [...] StartServers 3 MinSpareServers 3 MaxSpareServers 3 ServerLimit 50 MaxClients 50 MaxRequestsPerChild 1000
Also, a nifty shell script to give you an idea of MaxClients. Now I did not use this number it recommended, but it is still a helpful tool
#!/bin/bash echo "This is intended as a guideline only!" if [ -e /etc/debian_version ]; then APACHE="apache2" elif [ -e /etc/redhat-release ]; then APACHE="httpd" fi RSS=`ps -aylC $APACHE |grep "$APACHE" |awk '{print $8'} |sort -n |tail -n 1` RSS=`expr $RSS / 1024` echo "Stopping $APACHE to calculate free memory" service $APACHE stop MEM=`free -m |head -n 2 |tail -n 1 |awk '{free=($4); print free}'` echo "Starting $APACHE again" service $APACHE start echo "MaxClients should be around" `expr $MEM / $RSS`
Resources
- Configuring Apache for Maximum Performance | HowtoForge – Linux Howtos and Tutorials
- Test if mod_deflate is working
- Low Memory Issues with Apache
- Perl suggestions for MaxRequestsPerChild
- Tuning the Apache MaxClients parameter | 2bits.com, Inc. – Drupal Performance Optimization, Development, Managed Hosting, Customization and Consulting
- How Many Max clients/servers 4 Prefork compiled Apache to use with 512 MB Ram ??