Apache Tuning Part 1

December 30th, 2008 Category: Apache

This article applies to apache version 2.2.3 also it will work for other versions.

Apache needs a lot of memory, this will decrease performance on a machine with e.g. 1 GByte memory and about 60 users accessing the server simultaneously a lot. There is a simply method to save memory: disable all unused modules. Yes, it really helps!

Why does it help? Because every apache process started – and a lot will be started when several users are accessing the server – will load all enabled modules.

To get an overview how much memory is consumed by the modules use the command

lsof | grep apache | grep modules

Using this command you will also see which modules consumes much memory.

In my case only the following modules are used:

  • actions.load
  • authz_default.load
  • authn_file.load
  • auth_basic.load
  • authz_user.load
  • env.load
  • mime.load
  • rewrite.load
  • userdir.load
  • alias.load
  • authz_host.load
  • deflate.load
  • expires.load
  • negotiation.load
  • setenvif.load
  • headers.load
  • speling.load
  • cgi.load
  • dir.load
  • include.load
  • php5.load

Modules which are not needed are disabled using the command

a2dismod <module_name>