Pagurus: Eliminating Cold Startup in Serverless Computing with Inter-Action Container Sharing

Zijun Li, Quan Chen, Minyi GuoarXiv 2021

Abstract

Serverless computing (FaaS) suffers from "cold start" latency, where the time to initialize a container often dwarfs the actual function execution time. Pagurus is a novel system that eliminates cold starts by breaking the isolation between function containers. It allows functions to "borrow" idle containers from other functions with compatible software dependencies. Using a dual-level scheduling policy based on queuing theory and secure code re-packing, Pagurus reduces end-to-end latency by up to 75.6% compared to Apache OpenWhisk while maintaining performance guarantees for the original container owners.

The Cold Start Challenge

In modern serverless platforms, functions are encapsulated in containers to ensure isolation. However, when a function is invoked and no warm container is available, the system must perform a "cold start"—booting the container, initializing the runtime, and loading libraries. As shown in Figure 1, for many common workloads, this startup process can take seconds, whereas the actual execution might only take milliseconds.

Container startup vs. execution time across various workloads, highlighting the significant overhead of cold starts.

Current mitigation strategies like "keep-alive" or "pre-warming" are resource-intensive and often inefficient. Pagurus identifies a key opportunity: many functions sit idle in warm containers while others are stuck in cold starts. By enabling inter-action container sharing, Pagurus allows these idle resources to be repurposed dynamically.

Pagurus System Design

Pagurus introduces a hierarchical scheduling architecture to manage container sharing without compromising Quality of Service (QoS).

The Pagurus architecture, featuring dual-level scheduling and specialized container pools for sharing.
  1. Intra-action Scheduler: Operates at the function level. It uses an M/M/n queuing model to predict if a container can be safely lent out without violating the function's 95th-percentile latency target.
  2. Inter-action Scheduler: Acts as a global coordinator that matches "Renters" (functions needing containers) with "Lenders" (functions with idle capacity).

Containers are categorized into three distinct pools: Executant (running the owner's code), Lender (idle and available for sharing), and Renter (currently borrowed by another function).

Key Innovations

Similarity-based Re-packing

To facilitate sharing, Pagurus leverages the fact that many functions share common library dependencies (e.g., pandas, numpy). The system analyzes these dependencies and creates "lender images" that contain the union of libraries required by the lender and its potential renters. This allows a borrowed container to immediately support a new function's environment.

Security and Isolation

Sharing runtimes introduces security risks. Pagurus mitigates these through a code encryption module. Function code is stored in encrypted ZIP files and only decrypted within the container at runtime. Furthermore, uniform renaming of entry points (e.g., to main.py) hides the internal logic structure from potentially malicious renters.

Performance Evaluation

The researchers evaluated Pagurus using standard benchmarks like FunctionBench and Faas-profiler on a 2-node cluster.

  • Latency Reduction: Pagurus achieved a 75.6% reduction in end-to-end latency compared to standard OpenWhisk. It also outperformed state-of-the-art restore-based methods (like CRIU) by 51.9%.
  • Startup Speed: By borrowing containers, functions can start in under 10ms, effectively eliminating the cold start penalty.
  • Scalability and Efficiency: The system supported 3x higher bursty loads than traditional platforms and saved up to 6.75GB of RAM by reducing the need for redundant "keep-warm" containers.

Conclusion

Pagurus demonstrates that the strict isolation between function containers in serverless computing is a major source of inefficiency. By treating idle containers as a shared "borrowing economy," Pagurus significantly improves performance and resource utilization. While future work is needed to address the security implications of runtime sharing at scale, Pagurus provides a powerful blueprint for the next generation of high-performance serverless platforms.

Summary updated

BibTeX
@misc{li2021pagurus,
  author = {Zijun Li and Quan Chen and Minyi Guo},
  title = {{Pagurus: Eliminating Cold Startup in Serverless Computing with Inter-Action Container Sharing}},
  year = {2021},
  eprint = {2108.11240},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.11240},
}
Figure