Introduction
Distributed filesystems (DFS) are foundational to modern data centers, yet they face a persistent performance hurdle: metadata operations. Operations such as creating, deleting, or renaming files are traditionally synchronous, requiring clients to wait for multi-server coordination. SwitchFS (the system implementation of AsyncFS) addresses this by transforming synchronous metadata updates into asynchronous ones, leveraging programmable switches to maintain consistency without the latency penalties of traditional coordination.
The Metadata Bottleneck
In a typical DFS, metadata management involves a difficult trade-off between data locality and load balancing. Systems generally adopt one of two strategies:
- P/C Grouping: Files are stored on the same server as their parent directory. While this makes directory listings fast, it creates "hotspots" when a single directory experiences high activity.
- P/C Separation: Files are spread across multiple servers. This balances the load but requires expensive distributed transactions for every update to ensure the parent directory remains consistent.
SwitchFS breaks this deadlock by allowing updates to be asynchronous. A client can update a file's metadata locally and receive an immediate success message, while the update to the parent directory is deferred. This approach is justified by the observation that over 86% of directory updates are not immediately followed by a read operation.
System Architecture: In-Network Coordination
The innovation of SwitchFS lies in its use of programmable network switches (e.g., Intel Tofino) to manage "dirty" directory states at line rate.
- Asynchronous Metadata Protocol: By deferring directory updates, SwitchFS reduces the round-trip time for metadata operations to a single local update.
- In-Network Dirty Set: The switch maintains a compact hash table (the "dirty set") in its registers. It monitors traffic to track which directories have pending updates, avoiding the extra network hop required by dedicated coordination servers.
- Aggregation and Compaction: When a directory is finally read, the switch triggers an aggregation process. SwitchFS uses change-log compaction to merge multiple updates—such as repeated timestamp changes or file creations—into a single batch, significantly reducing server-side overhead.
Performance Evaluation
SwitchFS was evaluated against state-of-the-art baselines like CephFS and InfiniFS using both synthetic workloads (modeled after Alibaba’s PanguFS) and real-world traces from CNN training and thumbnail services.
Key results include:
- Throughput Gains: Under skewed workloads, SwitchFS achieved up to 13.34× higher throughput than Emulated-InfiniFS and 3.85× higher than Emulated-CFS.
- Latency Reduction: Average latency was reduced by approximately 60% compared to synchronous baselines.
- Scalability: As shown in the evaluation, SwitchFS maintains stable and high throughput even as the number of metadata servers or cores per server varies, effectively removing the metadata bottleneck that causes traditional systems to flatline.
Conclusion
SwitchFS demonstrates that the "read-after-update" gap in directory access patterns can be exploited to dramatically improve DFS performance. By offloading coordination to the network layer, it achieves high throughput and low latency while maintaining strict POSIX semantics. Future research will focus on scaling to multi-switch environments and addressing the memory constraints of programmable ASICs.
Summary updated