TL;DR
This paper provides the first comprehensive look at a massive production serverless workload (Azure Functions) and introduces a "hybrid histogram" policy that significantly reduces "cold starts." By intelligently predicting when a function will be called based on its history, the authors show how cloud providers can offer better performance while wasting fewer hardware resources.
What Problem Does This Paper Address?
In Function-as-a-Service (FaaS), developers upload code that runs only when triggered by an event (like an HTTP request or a timer). For the provider, this creates a massive headache: the Cold Start problem.
If a provider keeps every function "warm" (loaded in memory) all the time, it wastes a fortune on idle resources. If they "cold start" functions (load them from disk only when needed), the user experiences a significant delay—often longer than the execution of the function itself. Current industry standards use blunt "fixed keep-alive" policies (e.g., keep a function warm for 20 minutes after it runs). This paper addresses the lack of data on real-world workloads and the inefficiency of these one-size-fits-all policies.
Methods
The authors take a two-pronged approach:
- Characterization: They analyzed two weeks of production telemetry from Azure Functions, looking at invocation frequencies, trigger types (HTTP, Timer, Queue, etc.), execution times, and memory usage.
- The Hybrid Histogram Policy: Based on their findings, they designed a new resource management policy. Instead of a fixed timer, this policy maintains a compact histogram of idle times (the time between invocations) for each application.
- Pre-warming: It uses the histogram to predict when the next call is likely to happen and loads the function just-in-time.
- Adaptive Keep-alive: It calculates a tailored "keep-alive" window based on the 99th percentile of past idle times.
- Safety Valves: If a function’s behavior is too erratic (measured by the Coefficient of Variation), it reverts to a conservative fixed policy. For extremely infrequent functions, it uses ARIMA (time-series forecasting) to predict arrivals.
Datasets
The study uses a massive, real-world dataset from Microsoft Azure Functions collected over 14 days in July 2019. Crucially, the authors released a sanitized version of these production traces to the public, providing a vital benchmark for the research community that previously had to rely on synthetic simulations.
Key Insights and Ideas
- The Massive Skew: The workload is incredibly top-heavy. While the most popular functions are called billions of times, 81% of applications are invoked less than once per minute on average. However, the top 18% of apps account for 99.6% of all invocations.
- Short and Sweet: 50% of functions run in less than a second. This makes cold start latency (which can be several seconds) the dominant factor in performance.
- Predictability is Everywhere: Many functions are triggered by timers or follow periodic patterns. Even "random" HTTP triggers often show clusters of activity that a histogram can capture.
- One Size Fits None: A 20-minute fixed keep-alive policy is overkill for a function called every 30 seconds, but insufficient for a function called every 21 minutes. Tailoring the window to the specific app is the "aha moment" for efficiency.
Key Results
The authors evaluated their policy using both simulations and a real implementation in Apache OpenWhisk:
- Efficiency Gains: The hybrid policy can reduce the number of cold starts by 2.5x compared to a 10-minute fixed policy while using the same amount of memory.
- Resource Savings: To match the low cold-start rate of the hybrid policy, a fixed policy would need to keep functions warm for 2 hours, consuming 50% more memory.
- Low Overhead: The policy is computationally "cheap." Updating the histogram and making a prediction adds less than 1 millisecond of latency, making it practical for high-scale production environments.
Limitations and Future Work
- Granularity: The released dataset bins invocations into 1-minute windows. While sufficient for many management tasks, it loses the "micro-burst" patterns that occur at the sub-second level.
- Concurrency: The paper focuses on the "application" as the unit of scaling. It doesn't deeply explore how to manage multiple concurrent instances of the same function during massive traffic spikes.
- Complex Chains: Future work could look at "function chaining" (where one function calls another). Predicting the arrival of the second function in a chain is likely much easier if you know the first one just started.
Summary updated