Apache modules and performance

For best performance you need to strip down your apache binary – the less modules, the less memory used the better speed / performance you will get. If you are loading modules via DSO you can easily remove module from the loading list by commenting out the LoadModule option. If you have a module linked statically you will need to recompile apache http daemon.
By default 1.3 has compiled in the following modules:

Compiled-in modules:
http_core.c
mod_env.c
mod_log_config.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_access.c
mod_auth.c
mod_setenvif.c

you will need to compile apache and remove modules that are not needed, for example: mod_auth.c mod_imap.c using the following syntax:

./configure –disable-module=auth –disable-module=imap

I suggest you disable everything, except

mod_mime
mod_dir
mod_log_config
You can of course remove log config module if no logging is needed. If your site requires any specific modules or the ones listed above – you will need to enable them at the compilation time. It’s try and see option, for those, who are not 100% sure what modules are really needed.

Apache 2.0.* has compiled in the following modules by default:

Compiled in modules:
core.c
mod_access.c
mod_auth.c
mod_include.c
mod_log_config.c
mod_env.c
mod_setenvif.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_cgi.c
mod_negotiation.c
mod_dir.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_so.c

The most critical ones are again,  mod_mime;mod_dir; less mod_log_config.

Please note than DSO support is activated/enabled by default and you can turn it off by removing this module at the compilation time.


Leave a Reply