Freitag, 19. März 2010

Increase Your Server/HDD Performance With “noatime” Dramatically

Most people when they try to optimize their servers they always say tweak mysql, install APC, Xcache, or something similar but most people forget about optimizing the HDD. Forums often cause high I/O. You usually have to upgrade your hdd to 10k rpm+ but with noatime, you might not need to do that.

My I/O was around 1500-2000 blocks/a sec. With noatime modification I was able to reduce it to under 500. That’s atleast a 300% improvement if I do my math correctly. I remember reading a blog, someone with raid 0, gained 900% in improvements when they changed to noatime.

What’s noatime?
Linux has a special mount option for file systems called noatime. If this option is set for a file system in /etc/fstab, then reading accesses will no longer cause the atime information (last access time – don’t mix this up with the last modified time – if a file is changed, the modification date will still be set) that is associated with a file to be updated (in reverse this means that if noatime is not set, each read access will also result in a write operation). Therefore, using noatime can lead to significant performance gains.
Warnings
I’m a noob. However I did on my server and it worked. Also if you google noatime, you will a lot of threads on it and how it improves I/O. Use at your own risk. However I don’t think there’s any risk.

Step One.
# pico /etc/fstab (or whatever you use “nano”, “vi” etc)

Step Two.
Next add “noatime” into the file. I added noatime to 4 mounts. My /home /dir /var and /usr. For me those 4 usually cause the most I/O. Most people’s fstab should look like mine below except without the “noatime” line in there. I did read somewhere that, you should not add noatime to /proc and /boot.

Step Three.
type
# mount -a -o remount

thats all! with this mods could improve up to 300% performance boost from I/O of a servers