Introduction
In large-scale distributed file systems like HDFS, metadata operations—such as looking up file locations, checking permissions, or traversing directories—represent the primary performance bottleneck. Research indicates that up to 96% of all file-system requests are metadata-related. While client-side caching can mitigate some of this load, it introduces significant consistency challenges; invalidating stale caches across thousands of clients creates prohibitive overhead.
FMCache (also referred to as Fletch) addresses this by implementing a high-performance metadata caching framework directly within programmable network switches (e.g., Intel Tofino). By positioning the cache in the network data plane, FMCache provides a centralized, high-speed "middle ground" visible to all clients, effectively offloading metadata servers and slashing latencies.
System Design and Implementation
FMCache overcomes the inherent hardware limitations of programmable switches—such as limited SRAM and fixed-length processing pipelines—through three primary innovations.
Path-Aware Cache Management
Unlike standard key-value stores, file systems are hierarchical. Accessing /home/user/file.txt requires verifying every ancestor directory. FMCache ensures that if a file's metadata is cached, all its ancestors are also present. To handle this multi-step resolution within a single switch, FMCache utilizes a "recirculation" technique. As shown in Figure 1, packets loop through the switch's processing pipeline multiple times, resolving one directory level per pass.
Multi-Level Read-Write Locking
To maintain consistency without a slow central coordinator, FMCache implements a hardware-based locking mechanism using register arrays. It tracks active reads at every level of a path, ensuring that write operations (like chmod) only proceed when safe, thereby preventing "dirty reads" at line rate.
Local Hash Collision Resolution
Switches cannot store long, variable-length strings. FMCache hashes paths into 64-bit keys. To resolve rare hash collisions, a controller assigns unique 8-bit tokens to colliding paths. Clients include these tokens in their requests, allowing the switch to distinguish between paths instantly without storing full strings.
Evaluation
The system was evaluated using real-world metadata traces from Alibaba (Pangu), LinkedIn, and specialized workloads like CNN training and thumbnail generation.
- Throughput: FMCache achieved a 181.6% throughput increase over standard HDFS for the thumbnail generation workload. Compared to state-of-the-art client-side caching, it provided an additional 139.6% boost.
- Latency: For read-heavy workloads, FMCache reduced average and tail (p95/p99) latencies by 60-80% by serving requests directly from the data plane.
- Resource Efficiency: The implementation fits within the constraints of a Tofino switch, utilizing approximately 58% of available SRAM while maintaining standard L2/L3 routing at 3.2 Tbps.
Conclusion
FMCache demonstrates that moving file-system logic into the network data plane is a viable strategy for scaling distributed systems. By leveraging recirculation for hierarchical resolution and hardware-native locking for concurrency, it provides a high-performance, consistent cache that significantly outperforms traditional server-side and client-side approaches. Future work will focus on optimizing performance for write-heavy workloads and exploring cache-slicing across multi-switch topologies.
Summary updated