Accelerating Serverless Computing by Harvesting Idle Resources

Hanfei Yu, Hao Wang, Jian Li, Xu Yuan, Seung-Jong Park

Introduction

In Function-as-a-Service (FaaS) environments, developers benefit from a "pay-as-you-go" model but often struggle with optimal resource configuration. Current platforms like AWS Lambda or OpenWhisk typically require users to set a memory limit, which then dictates a fixed proportion of CPU power. This rigid coupling leads to two primary inefficiencies: over-provisioning, where users oversize functions to ensure reliability, and under-provisioning, where CPU-intensive but memory-light functions are throttled. Because serverless functions are short-lived and bursty, predicting real-time resource requirements is a significant challenge for providers.

The Freyr Architecture

To address these inefficiencies, researchers developed Freyr, a novel resource manager designed to sit within a serverless controller. Freyr decouples CPU and memory resources, treating them as independent pools to allow for granular "harvesting" of idle resources from over-provisioned functions and "acceleration" of those that are under-provisioned.

The Freyr system architecture integrated with a serverless controller and invoker.

Freyr utilizes a Deep Reinforcement Learning (DRL) agent based on the Proximal Policy Optimization (PPO) algorithm. To manage the vast action space of potential CPU and RAM combinations, the system employs a Score Network. Instead of selecting from a discrete list of actions, the network evaluates "state-option" pairs and assigns priority scores, ensuring the model remains lightweight (12 KB) and capable of low-latency inference (<10ms).

Key Insights: The Saturation Point

A fundamental observation driving Freyr is the existence of a "saturation point" for every function. This is the specific resource level beyond which additional CPU or memory yields diminishing or zero performance gains.

Latency saturation points for different serverless functions as a function of CPU and memory allocation.

By identifying these points, Freyr can safely harvest resources from functions that have been allocated more than they can effectively use. To protect against performance degradation, Freyr includes a Safeguard Mechanism. If a "victim" function's resource usage approaches 80% of its current allocation, the safeguard immediately triggers a "safe invocation" using the user's original defined resources.

Experimental Evaluation

The system was evaluated on a 13-node Apache OpenWhisk cluster using 10 real-world serverless applications, including machine learning (ResNet-50) and multimedia processing (FFmpeg). Invocation patterns were modeled after the Azure Functions public dataset to simulate realistic, bursty traffic.

Performance Results

  • Resource Efficiency: Freyr successfully harvested idle resources from 38.8% of invocations and reallocated them to accelerate 39.2% of other concurrent tasks.
  • Latency Reduction: The system reduced 99th-percentile (P99) response latency by 32.1% compared to the default OpenWhisk manager.
  • Speedup: Under-provisioned functions saw throughput improvements of up to 92%.
  • Reliability: Performance degradation for functions from which resources were harvested was kept under 6%, demonstrating the effectiveness of the safeguard mechanism.

Conclusion and Future Work

Freyr demonstrates that treating node-level resources as a fluid, harvestable pool can significantly improve both provider utilization and user experience. While the current implementation focuses on single-node harvesting, future iterations could explore cluster-wide reallocation. Additionally, while Freyr optimizes execution time, addressing the "cold start" problem remains a separate but complementary area for future serverless research.

Summary updated

BibTeX
@inproceedings{yu2022accelerating,
  author = {Hanfei Yu and Hao Wang and Jian Li and Xu Yuan and Seung-Jong Park},
  title = {{Accelerating Serverless Computing by Harvesting Idle Resources}},
  booktitle = {The Web Conference},
  year = {2022},
  doi = {10.1145/3485447.3511979},
}
Figure