Ran into an XFS issue the other day and after some searching and testing found a solution that almost doubled my performance with regards to write speeds. Shortly after, I needed to do the same thing on another system and couldn’t find the info and couldn’t find the steps in the history on the first server. I finally tracked down the info again to increase performance on Linux when using XFS file system.
It all started when I was having issues backup up my VMWare esxi box using a script. The script would time out on rotating the images and never finish. All the info pointed to an issue with journal based file systems and nfs. I switched to xfs and the problem remained. I tried everything and looked everywhere to fix the issue. Then I tried doing straight write performance tests and noticed the write speeds were horrendous. I was getting something like 40Mb/s on the actual box and about 35 Mb/s over nfs. Once I created the file system and mounted it with some different options, those same speeds went to about 75-80Mb/s on the box and ~70Mb/s over nfs. Problem solved.
Create xfs filesystem with a 64 megabyte log
# mkfs.xfs -f -l size=64m /dev/hda3
Mount filesystem with 8 log buffers, and atime and diratime disabled
# mount -o noatime,nodiratime,logbufs=8 /dev/hda3 /mnt/gentoo/
These simple tweaks do help! specially on large RAID partitions
Read the man pages for more on the options but it is pretty self explanatory. There are more options if you want to tune to your specific RAID array, however, I didn’t want to go that deep.
For more info on the actual statistics and tests for these changes, see the following article: