Spindles rule: Speed up your IO by using external journals
May 21st, 2009 by Tvrtko Ursulin
Imagine that you have two hard drives in your system and are wondering how to best utilise them? You are also not interested in redundancy but would like to squeeze out some more performance out of your system. You know flash storage is coming, but it is not affordable for you yet, or you have an extra drive sitting on the shelf and are wondering if you could use it somehow. Answer is that you could – because spindles rule and it is more likely than no you can use them to your advantage.
Most obvious choice is to setup RAID level 0 (stripping) but I will not talk about that here. Rather, it will be about a less know ability of most mainstream filesystems (ext3, JFS, XFS) to use an external journal. All write intensive (even read intensive if you have access times enabled) workloads are
also pretty journal intensive and since journals are a separate area on each partition that creates a fair amount of seeking. Seeking is of course bad for throughput and this is where your extra spindle will come in handy. Idea is to have one separate journal partition on the second disk for each partition
from the main disk. With JFS for example, journal is at most 128Mb, which means that couple of those next to each other will occupy a tiny disk area, enabling pretty efficient seeks.
This setup will give you increased performance, but also leave a huge portion of your second disk unused. Some of it would be ideal for swap, which you could either have there exclusively, or have it setup with equal priorities for stripped swap for extra performance. The rest could be used for temporary storage, either good old /tmp or a custom partition. /tmp is interesting
because, on the one hand putting it on a second disk will remove the benefit of having an external journal (unless you turn it completely and put it’s journal on the main disk, but I do not think that would make much sense), but on the other hand and depending on your typical workload, it might be
beneficial after all. Because any operation involving packaging files from elsewhere into a temporary file in /tmp, or operating on a copy before copying it back, will benefit from a separate spindle regardless of the journal location. There will probably be more remaining unused space on this disk which could be used for a infrequently used custom storage partition or similar.
Since I consider this an advanced filesystem setup, I will not go into details on how to set it up here, because I do not want to be blamed for loss of data while converting existing setups. Interested parties will have to figure it out for themselves.
















