3 ms·
Ext3, ext4, and XFS have a journal that's constantly being overwritten. On Btrfs, the file system is the journal. It does have a bit of a wandering trees proble
by cmurf 7y ago
Ext3, ext4, and XFS have a journal that's constantly being overwritten. On Btrfs, the file system is the journal. It does have a bit of a wandering trees problem [1], where F2FS expressly intends to reduce the wandering tree problem.[2] There's also different approaches that don't involve filesystems [3].
But I think you have to assess the crash resistance and repairability of filesystems, not just worry about write amplification. I think there's too much made about SSD wear. The exception are the consumer class of SD Card and USB flash, those are junk to depend on for persistent usage, best suited for occasional use, and all eventually fail. If you're using such flash, e.g. in an embedded device, you probably want to go with industrial quality flash to substantially improve reliability.
Consider putting swap on zram [4] or using zswap [5]. I've used both, typically with a small pool less than 1/2 of RAM. I have no metric for clearly deciding a winner, either is an improvement over conventional swap. Perhaps hypothetically zswap should be better because it's explicitly designed for this use case; where zram is a compressed RAM disk on which you could put anything, including swap. But in practice, I can't tell a difference performance wise.
[1] https://arxiv.org/abs/1707.08514 https://arxiv.org/abs/1707.08514
[2] https://lwn.net/Articles/520829/ https://lwn.net/Articles/520829/
[3] https://www.usenix.org/conference/fast13/technical-sessions/presentation/lu_youyou https://www.usenix.org/conference/fast13/technical-sessions/...
[4] https://www.kernel.org/doc/Documentation/blockdev/zram.txt https://www.kernel.org/doc/Documentation/blockdev/zram.txt
https://github.com/systemd/zram-generator https://github.com/systemd/zram-generator
[5] https://www.kernel.org/doc/Documentation/vm/zswap.txt https://www.kernel.org/doc/Documentation/vm/zswap.txt