Home > Computing, Linux > Optimizing filesystem performance for webservers in linux by disabling access time writes

Optimizing filesystem performance for webservers in linux by disabling access time writes

March 31st, 2009 Leave a comment Go to comments

I just came across some interesting reading material concerning the linux POSIX compliance for file systems. I stumbled upon it after looking for the reason (or a solution) for one of my webservers which has about 95% write I/O instead of read I/O, which I thought was weird for that particular load. To be compliant with POSIX access times should be registered thus this is enabled by default.  So it could be noticeably faster for web servers to disable the writing of atime timestamps to each file that is read at each request (it will even write an atime-stamp to disc when the whole thing is cached!). This is off course dependant on your hardware, software and system load.

It should be noted however that some back-up software solutions (archiving) need the atime stamp to work properly. One of the other downsides of this is that you can no longer find old unused files with a command like:

find /var/www/html -atime +[time in days in the past] -print

Or offcourse, the use of atime timestamps in forensics.

To disable the access time timestamp writing add the option “noatime” to your filesystem mounts. Remember that your file system mounts and their options can be found in the /etc/fstab file of your linux install. After editing your partition you can remount all partitions with

mount -a

or only the changed mount with:

mount -o remount /
# With / being the name of your partition or device name.

I still have no idea how this would work out on the box in question. It might just be a large numer of logs written to disc (etcetera) instead of atime updates resulting from the many file reads a web server does. I guess I will just have to try it out to see if it makes a real difference for that box.

  1. No comments yet.
  1. No trackbacks yet.