With Great Freedom Comes Great Opportunity: Rethinking Resource Allocation for Serverless Functions

Muhammad Bilal, Marco Canini, Rodrigo Fonseca, Rodrigo Rodrigues

Abstract

Current serverless platforms simplify resource management by "bundling" CPU and memory together, but this convenience comes at a high price in efficiency. This research demonstrates that by decoupling these resources and using Bayesian Optimization to find the "sweet spot," developers can achieve up to a 40% reduction in cost and a 50% boost in performance.

The Problem: The "Bundling" Tax

In the world of serverless computing (Function-as-a-Service or FaaS), the promise is "no-ops": developers write code, and the provider handles the rest. However, major providers like AWS Lambda and Google Cloud Functions currently offer very few "knobs" for optimization. Typically, a user selects a memory size, and the provider automatically assigns a proportional amount of CPU power.

This approach is fundamentally flawed. A memory-intensive function with simple logic is forced to pay for expensive, high-end CPU shares it doesn't need. Conversely, a compute-heavy function might be throttled unless the user over-provisions memory. Furthermore, users lack choice over the underlying hardware architectures (Intel, AMD, ARM), which perform differently depending on the task. This paper argues that giving users more granular control—"Great Freedom"—leads to "Great Opportunity" for significant optimization.

Methodology: Decoupling and Optimization

The researchers developed a framework using OpenFaaS on Kubernetes to systematically explore a search space of 288 configurations per function. These configurations varied across three dimensions: CPU share, memory limit, and instance families (covering ARM, Intel, and AMD architectures).

Comparison of resource allocation strategies: Decoupled vs. Proportional CPU.

To navigate this massive search space efficiently, the study employed Bayesian Optimization (BO) with Gaussian Processes (GP). This black-box optimization method builds a surrogate model of the function's performance to predict optimal configurations, balancing exploration of unknown settings with exploitation of known high-performing areas.

Benchmarking Serverless Workloads

The approach was evaluated using six benchmark functions representing common serverless tasks: facedetect and faceblur (image processing), transcode (video transcoding), ocr (optical character recognition), linpack (mathematical solvers), and s3 (data I/O). These benchmarks cover various resource bottlenecks, from CPU-heavy transcoding to network-intensive data transfers.

Key Results and Insights

The study revealed that tying CPU to memory is a major source of waste. By decoupling them, the system can identify "lean" configurations that current cloud providers do not offer.

Normalized best execution time (ET) and cost (EC) across benchmarks.
  • Performance and Cost Gains: Decoupling CPU and memory led to 40% lower execution costs compared to standard "coupled" configurations. Optimized VM type selection improved execution time by up to 50%.
  • Rapid Optimization: The BO-GP algorithm consistently found near-optimal configurations (within 5-10% of the absolute best) in just 20 trials, making it practical for real-world deployment.
  • Hardware Heterogeneity: Shifting workloads between architectures (e.g., from Intel to ARM-based Graviton2) significantly impacts the cost-performance profile.
  • Model Generalization: Configurations that performed well for one input size generally remained effective for others, suggesting that providers can use generic models for resource allocation.

Conclusion and Future Directions

While the benefits of decoupling are clear, challenges remain. The current study focuses on execution time and cost, but future work is needed to analyze the impact of fine-grained configurations on "cold start" latency. Additionally, while generic models are effective for most tasks, highly data-sensitive functions like linpack may require more sophisticated, data-aware models. Ultimately, providing more granular resource control allows both users and providers to significantly improve the efficiency of serverless computing.

Summary updated

BibTeX
@inproceedings{bilal2023with,
  author = {Muhammad Bilal and Marco Canini and Rodrigo Fonseca and Rodrigo Rodrigues},
  title = {{With Great Freedom Comes Great Opportunity: Rethinking Resource Allocation for Serverless Functions}},
  booktitle = {EuroSys},
  year = {2023},
  doi = {10.1145/3552326.3567506},
}
Figure