Apache web server tips and tricks

There are may small and big features in Apache that make it one of the easiest web server to configure and administrate.In this post I am posting some of the tips and tricks that I found incredibly useful.

Finding request serving time as an extra header in Apache 2.4

This one is especially useful if you have server side dynamic content(like PHP pages or reverse proxy calls) and want to find out the exact time taken by apache since the request came in and the request was sent out by apache

Using Disk Cache in place of Memory Cache for  static content.

Contrary to what one may think, memory cache in Apache is slower than disk caching, because mod_mem_cache uses the read API to load the file into memory where as mod_disk_cache uses sendfile API to directly send file to endpoint, which doesn’t require the file to be read bit by bit and its also cached in the operating system’s file system cache.

Here is a snippet to enable mod_disk_chche in Apache.

Sadly mod_mem_cache doesn’t provide an upper bound on how much memory it will use to make sure that you manually free the space. This can be done using the following command in linux.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.