Running Apache on Low Resources

Last modified: 
Friday, March 27th, 2015


These are some notes about running Apache2 on an Ubuntu virtual machine for development purposes. In most cases these notes apply as well to typical low-resource environments.

Apache2 RAM Segfault

When running a default Ubuntu install of Apache you may find Apache keeps connections alive for a very long time
and begins to devour RAM until it segfaults and freezes the virtual machine. The following changes to the MPM prefork configuration in apache2.conf should prevent this from happening. These settings may not be suitable for production environments.

# apache2.conf

StartServers          2
MinSpareServers       2
MaxSpareServers      5
ServerLimit          20
MaxClients           20
MaxRequestsPerChild  10000

KeepAlive Off

If your development machine is not operating under heavy CPU load, you can set ''[=KeepAlive=] Off'' in ''apache2.conf''. This may cause a dramatic spike in CPU use per page load, but this spike should drop off immediately after the Apache has finished handling the request.

# apache2.conf
KeepAlive Off

The operator of this site makes no claims, promises, or guarantees of the accuracy, completeness, originality, uniqueness, or even general adequacy of the contents herein and expressly disclaims liability for errors and omissions in the contents of this website.