I can’t remember the last time i used default mkfs or mount options… oh yeah, that’s right – by accident.
Anyway… I did a little experiment today.
The filesystem is my laptop /home – XFS, 100GB, 95% used (so 5-6GB free), rather aged. This is where a lot of my MySQL development is done. Mkfs options: 128MB log, version2 log. Mount options: logbufs=8, logbsize=256k. All of this geared towards increasing metadata performance.
Why metadata performance? well… source code trees are a lot of metadata :)
So, let’s try some things: cloning a repository and then removing the repository.
Two variables are being tested: mounting the file system with nobarrier (or barrier, the default). Write barriers tell the disk to ensure write order to the platter when write cache is in use. Also testing disabling (or enabling, the default) the disk write cache.
NOTE: the last option which has the write cache enabled and write barriers disabled is NOT SAFE. If your machine crashes, you loose data, and potentially your file system ends up corrupted.
So I’m now disabling my disk write cache and mounting with nobarrier.
If you use real disk arrays – e.g. battery backed write cache RAID boxes, the story is likely very different!