
The Apache web server can use up a pretty large chunk of RAM. The last thing you need in a high traffic situation is to start swapping. One way to avoid swapping is to make sure Apache is utilizing the smallest amount of memory possible. One quick and easy way to accomplish this is to stop loading unnecessary modules.
What you need to do is open up your httpd.conf file and page down to the section that has all the LoadModule lines. Then, examine each line that starts with LoadModule one by one and determine if you actually use the module in question. If not, just place a # symbol at the front of the line to comment it out. You’ll then want to comment out the corresponding AddModule a little further down in the config file.
So, now you may be wondering how to figure out if you need a module or not. Well, the best thing to do is just look up each module and read the description on it. You can find a list of modules here. Note that these are the modules that ship with apache. If you are using some 3rd party module, you won’t find it on that page and you should really already know about that module given you had to add it yourself.
Some common modules that you can fairly safely comment out are info_module, speling_module, digest_module, unique_id_module, and log_forensic_module.
Of course, once you are done editing the config file, you need to restart Apache for the changes to take place. Commenting out unused modules in my Apache installation has saved me roughly 3meg per a child. Across all child processes, this can save me quite a chunk of RAM and help me avoid the dreaded swap!
