4 Apache Performance Tips

Previously, we revealed some helpful security tips for Apache web servers. Today, we are back with more tips to help boost your Apache performance.

1. Prefer mod_disk_cache over mod_mem_cache – Having a caching module is definitely a good idea for Apache, but you should use mod_disk_cache rather than mod_mem_cache. The latter can be quite expensive in terms of memory usage and may not produce the level of results you likely expect.

2. Use a flat hierarchy for mod_disk_cache – navigating through a large number of directories will cause htcacheclean to take a long time to clean up your cache directory. Instead, keep mod_disk_cache at CacheDirLength=2 and CacheDirLevels=1

3. Cache on a separate disk – Use a separate disk to speed up caching. You may even want to use one with faster read/write speeds, such as a solid state drive (SSD) or flash cache card.

4. Use piped logging – In the past, the only way to log Apache activity and errors was for it to save that information to files. This process uses a considerable amount of memory, especially on larger sites. It can also bog down the server during log rotations. Piped logging sends the information to another process, allowing it to handle logging for Apache.