Every file open, list or rename in a big distributed file system first goes through a metadata service, and today that service is a fixed cluster of servers that is either too small for a burst or wastefully large the rest of the time — λFS runs the metadata servers as serverless functions that keep a cache in their memory, adds a fast direct TCP path so the functions are not slowed by HTTP, and a cache-invalidation protocol so many function copies stay consistent, reaching up to 4.13 times the throughput, 90 percent lower latency and 86 percent lower cost than HopsFS on a Spotify-derived workload.
The argument in one glance
-
Problem
The metadata service is on the path of every file operation, and its size is picked by hand
A distributed file system such as HDFS separates file contents (spread over many DataNodes) from metadata (the directory tree, file names, permissions, block locations), which lives in a metadata service. A client must ask that service before it can open, list, rename or delete anything. So the metadata service caps the whole system. Real workloads are bursty, and nobody can predict the right number of metadata servers in advance.
-
What people did
Scale the metadata service out as a fixed cluster of servers
HopsFS keeps the metadata in a sharded in-memory database (MySQL Cluster NDB) and puts a cluster of stateless NameNodes in front of it to handle client requests. IndexFS and InfiniFS use a fixed cluster of metadata servers plus heavy client-side caching.
-
Why it fell short
Fixed clusters are either too small or wasteful, and stateless servers pay the database on every request
HopsFS NameNodes keep no metadata, so every operation goes to the database and throughput is capped by the database. Beating plain HDFS took as many as 60 NameNodes and 12 database servers. And because the cluster size is fixed, the admin either provisions for the peak, wasting machines most of the time, or for the average, and the system falls behind during bursts.
-
This paper's idea
Run the NameNodes as serverless functions that cache metadata in their own memory and scale themselves
λFS makes each NameNode a Java serverless function. Functions are elastically added and removed by the platform, billed only while working, and their combined memory forms a metadata cache in front of the database. To make this fast and correct, λFS adds a direct TCP request path beside the slow HTTP one, a small auto-scaling policy that mixes the two, and a coherence protocol that invalidates cached copies before any write.
Why this problem is worth solving
A distributed file system
A file system whose data is spread over many machines in a cluster, used by big-data and machine-learning jobs. Examples are the Google File System and the Hadoop Distributed File System (HDFS). metadata service
The part of a distributed file system that owns the namespace (directories, names, permissions, block locations) and executes operations such as open, rename and delete. In HDFS it is called the NameNode.
Two facts make this hard. First, metadata workloads are bursty; the paper cites measurements from production clusters and uses a workload derived from Spotify’s 1,600-node HDFS cluster in which spikes reach 7 times the base rate. Second, it is very hard to pick the right size for a metadata cluster ahead of time. If you provision for the spike, you pay for idle machines almost all the time. If you provision for the average, the system falls behind whenever a spike arrives. That is the choice today’s scaled-out designs force on an administrator.
Serverless functions
Function-as-a-Service, also called serverless computing. A cloud model where you upload a function and the provider runs as many copies as needed, starting and stopping them automatically, and bills you only for the time they run. AWS Lambda and Apache OpenWhisk are examples.
What people did before
HopsFS
A distributed file system that extends HDFS by moving the metadata into MySQL Cluster NDB, a sharded in-memory database, and using a cluster of stateless NameNodes to handle client requests. NDB
MySQL Cluster NDB, a distributed, sharded, in-memory database with ACID transactions, used by HopsFS and λFS as the persistent metadata store.
IndexFS and InfiniFS use a fixed cluster of metadata servers with heavy client-side caching. InfiniCache, an earlier system from the same lab, used the memory of AWS Lambda functions as a cache for large read-only objects, but invoked a function over HTTP for every operation and never scaled, which the evaluation shows is far too slow for a metadata service.
All of these share one gap: none of them is elastic at the metadata layer. Someone still has to choose a cluster size.
-
Client library new
Hashes the parent directory of the path to pick which of the n function deployments owns it, then sends the request over a direct TCP connection if one exists, or over HTTP through the FaaS gateway if not (or with about 1 percent probability, to trigger scaling).
-
FaaS gateway (HTTP path only)
Routes the HTTP request to a running NameNode function of that deployment, or starts a new one if none is free. This is the only path the platform can see, so it is the only path that causes scale-out.
-
Serverless NameNode new
A Java function holding a trie of cached metadata. Serves reads from the cache when possible; on a miss, fetches from the database and caches. After an HTTP request it opens a TCP connection back to the client so later requests skip the gateway.
-
Coherence protocol (writes only) new
Before a write, the leader NameNode sends an invalidation to every deployment caching part of the path, waits for acknowledgements through the Coordinator (ZooKeeper), then takes database locks and commits.
-
Persistent metadata store
MySQL Cluster NDB, unchanged from HopsFS. Holds the ground truth with ACID transactions; also stores block reports and DataNode liveness that HopsFS used to keep in NameNode memory.
The idea
The core move is to make each NameNode
In HDFS terminology, the metadata server. In λFS, a Java application running inside a serverless function instance; the two terms are used interchangeably.
That simple statement runs into three problems with serverless platforms, and most of the paper is the answer to each.
Problem 1: HTTP is slow. The normal way to call a function is an HTTP request through the platform’s API gateway, which the paper measures at 8 to 20 milliseconds end to end for a read. That is far worse than HopsFS. So λFS uses a hybrid path. The first request to a deployment goes over HTTP. The function that serves it then opens a TCP connection directly back to the client’s machine (the client puts its address in the HTTP payload). From then on the client sends requests over that connection, at 1 to 2 milliseconds. Clients on the same virtual machine share one TCP server, and a client with no connection to some deployment can borrow another client’s connection on the same machine.
Problem 2: TCP hides load from the platform. The platform only sees HTTP requests, so if every request went over TCP it would never start new functions. λFS’s auto-scaling policy is deliberately simple: each TCP request is replaced by an HTTP request with a small configurable probability, empirically at most 1 percent. As load grows, the absolute number of HTTP requests grows too, and the platform scales out the deployment. A second, coarser knob is how many concurrent HTTP requests one function instance may serve (the authors extended OpenWhisk to expose this); setting it near 1 forces the platform to start more instances. The paper notes it avoided feedback-loop autoscalers such as Kubernetes’ Horizontal Pod Autoscaler because their delay is too long for sudden bursts.
Problem 3: many copies of the same cached entry. Functions cannot be addressed by name, so the same directory’s metadata may be cached in several instances of the same deployment. λFS partitions the namespace
The tree of directory and file names of a file system. λFS splits it across n function deployments by hashing the parent directory of each path, so all entries of one directory live in the same deployment. n deployments by hashing the parent directory, which sends all children of a directory to one deployment, and then runs a coherence protocol on writes, described in the walkthrough below.
Step by step
A read that hits, a read that misses, and a write, following the paper's Figure 5 and Algorithm 1.
Step 1 of 8
Read /nts/notes.txt: pick the deployment
The client library hashes the parent directory /nts and gets, say, deployment NameNode3. It already has a TCP connection to an instance of NameNode3, so it sends the request over TCP in one network hop.
The hashing of the parent directory, not the full path, means listing a directory or resolving a path touches one deployment. λFS keeps HopsFS INode Hint Cache on the client side so path resolution is one batched query instead of one round trip per path component.
Why it works
The design turns each weakness of serverless platforms into something manageable rather than fighting it.
- Small functions, many of them. A serverless function has little CPU and memory compared to a server. λFS runs each NameNode with about 5 to 6 vCPUs and, for the industrial workload, as little as 6 gigabytes of RAM, but runs dozens of them. Because each instance is small and busy, utilization is high; HopsFS NameNodes, by contrast, sat at about 70 percent CPU because they merely forward requests to the database.
- A cache in front of the database. HopsFS’s throughput is capped by NDB because every request reaches it. In λFS, 95 percent of operations in the Spotify workload are reads and most of those hit the function cache, so the database sees mostly writes. The paper confirms this with a run where the cache was cut to below half the working set: throughput dropped to 70,000 to 80,000 operations per second in the largest burst, still above HopsFS.
- Elasticity without a controller. The random HTTP replacement makes scale-out a side effect of load. In the Spotify run, the number of active NameNodes visibly rises at the start and again at the 200-second spike.
- Pay only while serving. Under AWS Lambda pricing, a function that served no request in a millisecond costs nothing in that millisecond. Combined with fewer total vCPUs (at most 165 to 180 of the 512 available), the same workload cost 2.50 on HopsFS.
What it costs
- Writes are slower. Every write runs the invalidation protocol before it can commit. In the Spotify workload HopsFS finished writes 1.5 to 5.55 times faster than λFS. Since the workload is 95 percent reads, average latency still fell sharply, but a write-heavy workload would look different.
- Write throughput is capped by the database. For
create fileλFS was 1.49 times faster than HopsFS; formkdirthe two were about equal, because NDB, not the NameNodes, is the bottleneck. - Fixed partitioning. The number of deployments
nis fixed; only the number of instances inside each deployment scales. That makes the hashing deterministic and simple but means a hot directory is served by one deployment (scaled out to many instances). - Engineering effort. λFS is a fork of HopsFS 3.2.0.3 with about 36,700 lines of new code, more than two person-years of work, plus a modified OpenWhisk and a set of failure-handling rules (resubmission with exponential backoff and jitter, cached results for retried requests, straggler cancellation at 10 times the average latency).
- Reclamation. Cloud providers can reclaim warm functions at any time; the paper leaves minimizing that impact on commercial platforms as future work.
Evaluation
All experiments ran on AWS r5.4xlarge machines (16 vCPU, 128 GB RAM) with OpenWhisk on Elastic Kubernetes Service and a 5-node MySQL Cluster NDB, and results were cross-checked on Google Cloud. Both λFS and HopsFS were capped at 512 vCPUs, which the authors note limits λFS relative to a real, nearly unbounded FaaS platform. The main workload replays the operation mix from Spotify’s 1,600-node HDFS cluster (69 percent reads, 17 percent stat, 9 percent ls, 2.7 percent create, 1.3 percent mv) for 5 minutes at a random rate drawn every 15 seconds from a Pareto distribution, with spikes up to 7 times the base rate. HopsFS+Cache is HopsFS with an in-memory cache added to its NameNodes, a serverful stand-in for λFS’s caching layer.
| Property | HopsFS | HopsFS+Cache | λFS |
|---|---|---|---|
| Spotify 25k ops/s base: average throughput | 38,134 ops/s | 45,945 ops/s | |
| Spotify 25k: average latency | 10.58 ms | 3.35 ms | |
| Spotify 25k: 164k ops/s spike at t=200 s | Could not sustain above ~38k; fell behind | Completed | |
| Spotify 50k ops/s base: average throughput | 44,956 ops/s (never reached base rate) | not reported | |
| Spotify 50k: average latency | 22.40 ms | not reported | |
| Cost of the 25k workload (AWS Lambda prices) | $2.50 | $2.50 | |
| Write latency | 1.5 to 5.55x faster than λFS | similar to HopsFS | |
| Client scaling, 8 to 1,024 clients, read/stat/ls throughput | baseline | lower than λFS for read and ls; equal for stat | |
| Auto-scaling on vs. off (read/stat) | n/a | n/a |
Other results: a cost-normalized HopsFS+Cache given the same dollar budget as λFS (72 or 144 vCPUs) could not sustain the bursts. λFS’s performance-per-cost was 3.33 times that of HopsFS+Cache. Killing an active NameNode every 30 seconds during the Spotify workload caused only brief dips; the workload completed, including the 164,000 ops/s spike. Large mv of directories with 262,000 to 1,000,000 files took 6.5 to 25 seconds on λFS, 13 to 16 percent less than HopsFS for the smaller sizes and equal for the largest, because the database dominates. Porting λFS to IndexFS on a BeeGFS cluster (4,472 lines) gave consistently higher read throughput and much higher write throughput than IndexFS on a 64-vCPU OpenWhisk cluster. Adding a second FaaS platform, Nuclio, took 108 lines.
Check your understanding
1. Why does HopsFS throughput stay capped even when more NameNodes are added?
2. Why does λFS deliberately send about 1 percent of requests over slow HTTP instead of always using its fast TCP connections?
3. What guarantees that a write in λFS does not leave a stale copy of the metadata in some function cache?
4. Which type of operation did λFS NOT speed up relative to HopsFS, and why?
5. How is the file system namespace divided among the n serverless deployments?