FMI: Fast and Cheap Message Passing for Serverless Functions

Marcin Copik, Roman Böhringer, Alexandru Calotoiu, Torsten Hoefler

Introduction

Serverless computing, or Function-as-a-Service (FaaS), has revolutionized cloud development by offering seamless scalability and a "pay-as-you-go" billing model. However, a significant bottleneck remains: communication. In standard cloud environments, functions are executed in isolated sandboxes that cannot accept incoming network connections. This isolation forces developers to use "mediated" communication, where data is written to and read from slow intermediaries like AWS S3 or DynamoDB. This process is both time-consuming (often incurring 10-100ms of latency) and expensive, negating the elasticity benefits for data-intensive workloads like machine learning.

The FMI Framework

To address this, the authors developed the FaaS Message Interface (FMI), a high-performance framework that brings MPI-style message passing to the serverless world. FMI provides a standardized API for point-to-point and collective operations (e.g., broadcast, reduce, gather) that is portable across cloud providers.

The core innovation of FMI is NAT Hole Punching (TCPunch). Since serverless functions are typically hidden behind NAT gateways, they cannot directly address one another. FMI utilizes a public relay server to facilitate an exchange of external IP addresses and ports between functions. Once this handshake occurs, the functions establish a direct peer-to-peer TCP connection, bypassing cloud storage entirely.

The NAT Hole Punching (TCPunch) process used by FMI to establish direct peer-to-peer connections between isolated functions.

Performance Evaluation

The researchers evaluated FMI using synthetic benchmarks and a practical case study involving K-Means clustering on the HIGGS high-energy physics dataset. The results demonstrate that direct TCP communication is significantly superior to storage-based alternatives across all message sizes.

As shown in the latency distributions below, FMI's direct TCP approach achieves microsecond-level latency for small messages (0.31ms), whereas S3-based communication remains in the double-digit millisecond range. Even for larger 1 MB messages, TCP maintains a massive performance lead over Redis and S3.

Comparison of communication latency for one-byte and 1 MB messages across different storage backends and FMI's direct TCP approach.

Key Insights and Results

  • Massive Speedups and Cost Reductions: In the distributed K-Means application, FMI achieved a 162x speedup in communication time and reduced costs by up to 397x compared to a DynamoDB-based implementation. Because serverless users pay for active execution time, faster communication translates directly into lower bills.
  • Scalable Collectives: By implementing optimized collective algorithms like binomial trees, FMI avoids the bottlenecks common in one-to-many communication patterns. It successfully scaled to 256 concurrent functions, outperforming Redis, which showed irregular failures at that scale.
  • Bypassing the Sandbox: The research proves that the networking isolation of serverless functions is a configuration hurdle rather than an insurmountable security barrier. Peer-to-peer communication is achievable on current infrastructure without requiring provider-side changes.

Limitations and Future Work

While FMI represents a major leap forward, it currently lacks robust fault tolerance; if one function fails, the entire group exits. Future work may involve implementing automated recovery policies. Additionally, because serverless environments are "black boxes," FMI cannot yet exploit physical co-location (e.g., shared memory between functions on the same host) for even greater performance gains.

Ultimately, FMI demonstrates that high-performance computing (HPC) patterns are not only possible but highly efficient in the serverless cloud.

Summary updated

BibTeX
@inproceedings{copik2023fmi,
  author = {Marcin Copik and Roman Böhringer and Alexandru Calotoiu and Torsten Hoefler},
  title = {{FMI: Fast and Cheap Message Passing for Serverless Functions}},
  booktitle = {ICS},
  year = {2023},
  url = {https://openreview.net/forum?id=dhtUzGE6HH},
}
Figure