On Thursday 28 June 2012, Andrew Bradford wrote:
I think I'm going to go with 8MiB erase blocks on this. It's going to be an ext4 disk and I'll partition at 24MiB bounds, just in case 3MiB is really the proper eraseblock.
Right.
There are a few other things you can do:
- Set the stride= and stripe-width= to 8MB. the RAID configuration has a
lot in common with flash media, so it can only improve performance if you do that.
So for example, I'd set stride to 8MiB and stripe-width to 1?
exactly.
- Use a separate partition for an external journal and align that to 8MB
as well. Otherwise the journal might not be erase block aligned (it might do that automatically when you set the stripe-width as above, don't know yet).
I have a 2 erase block area (soon to be a partition) at the beginning of the drive set aside for this but haven't yet set it up. I'm considering either putting the journal there, or running without a journal. I'm a little queasy about having no journal, the machine I use most often is a laptop that overheats after a few hours causing memory issues.
Yes, I think in general you're better off with a journal than without.
- Consider using btrfs instead of ext4. According to our research, 3 or 4
erase blocks is not really enough for ext4, but btrfs can cope with this unless you do a lot of sync() operations, which require more and would work better on ext4.
I had 1 bad experience with btrfs and lock-ups with a few SD cards when setting a few non-standard things and that turned me off from it. I'll look at it again, but for now I'm getting decent performance with ext4 (faster boot than the spinning disk in my desktop and only the occasional stutter in the UI). Setting elevator to noop and moving to relatime are next, then if I want more I'll look at btrfs or etx4 with stride and stripe-width.
I'm actually currently booted from the disk in Debian 6 without any optimizations beyond aligning partitions to erase blocks on ext4. apt appears to run much more quickly than I've experienced on my Beaglebones with SanDisk 4GB microSD (that I've sent results in for before, but those cards had really bad random (0 open-au basically)).
Ok. Chris Mason also told me that btrfs should be much better regarding the problem of apt, which used to cause a lot of duplicate data being written in older versions.
Arnd