Analyzing IO Amplification in Linux File Systems

Jayashree Mohan, Rohan Kadekodi, Vijay ChidambaramarXiv 2017

Abstract

Modern file systems provide essential features like crash consistency, snapshots, and checksums, but these capabilities often come with significant storage overhead. This paper presents the first systematic study of IO amplification—the ratio of actual storage traffic to requested user data—across five major Linux file systems: ext2, ext4, XFS, btrfs, and F2FS. The authors quantify the "hidden" work performed by these systems, revealing that simple metadata updates can trigger hundreds of kilobytes of storage traffic. The study introduces the CReWS conjecture, highlighting the inherent trade-offs between consistency and amplification in general-purpose file systems.

Introduction

While IO amplification has been extensively studied in the context of key-value stores and databases, file systems have traditionally been evaluated primarily on throughput and latency. However, the emergence of Flash-based SSDs with limited write endurance and byte-addressable Non-Volatile Memory (NVM) has made the efficiency of storage traffic a critical bottleneck. This research aims to quantify the extra reading and writing that occurs under the hood during common file system operations.

Methodology

The researchers evaluated five file systems representing diverse design philosophies:

  • ext2: A simple system without crash consistency.
  • ext4: A widely-used system employing metadata journaling.
  • XFS: A high-scalability system also using metadata journaling.
  • btrfs: A Copy-on-Write (CoW) system with advanced features like snapshots and checksums.
  • F2FS: A log-structured file system optimized specifically for flash storage.

Using block-level monitoring tools (blktrace, dstat, and iostat), the study measured three primary metrics: Write Amplification (WA), Read Amplification (RA), and Space Amplification (SA).

The CReWS Conjecture

A central theoretical contribution of this work is the CReWS conjecture. It posits that a general-purpose file system cannot simultaneously achieve strong Consistency while maintaining low Read, Write, and Space amplification. This suggests that file system designers must navigate a complex trade-off space where improving one metric often degrades others.

Experimental Results

Micro-benchmarks and the "Btrfs Tax"

The impact of IO size on write amplification is most pronounced in CoW-based systems. As shown in Figure 1, btrfs exhibits a staggering 32x write amplification for 4KB random writes. This is due to the necessity of updating multiple internal structures, including checksum, extent, and file trees, for every operation.

Write amplification across different IO sizes.

Even for journaling file systems like ext4 and XFS, write amplification remains significant at small IO sizes but stabilizes as the request size increases. Interestingly, XFS was found to be more efficient than ext4 for metadata updates despite their similar journaling mechanisms.

Metadata Costs

The overhead of metadata operations is a major source of amplification. Simple tasks like creating a file or renaming a directory result in substantial storage traffic.

Storage costs for common metadata operations.

As detailed in the metadata cost analysis (Figure 2), a single file rename in btrfs triggers 648 KB of write IO. In contrast, F2FS, despite also using log-structured principles, remains significantly leaner, requiring only 20 KB for the same operation. This demonstrates that log-structured designs can be highly efficient if optimized correctly.

Macro-benchmarks

Real-world workloads further highlight these disparities. In the Filebench Varmail benchmark, which simulates a mail server with frequent small writes and fsync() calls, btrfs performed 38% more write IO than the baseline ext2 and consumed 39% more storage space. During a Linux kernel compilation, write costs across all systems were relatively similar, but btrfs still showed the highest space cost.

Conclusion

This study reveals that modern file system features come at a high cost in terms of IO amplification. The "amplification hell" observed in block-based interfaces suggests a need for new "lean" file system designs, particularly for next-generation NVM. By moving toward byte-addressable updates and minimizing metadata overhead, future systems may finally overcome the constraints described by the CReWS conjecture.

Summary updated

BibTeX
@misc{mohan2017analyzing,
  author = {Jayashree Mohan and Rohan Kadekodi and Vijay Chidambaram},
  title = {{Analyzing IO Amplification in Linux File Systems}},
  year = {2017},
  eprint = {1707.08514},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1707.08514},
}
Figure