Abstract
Serverless computing has transformed cloud application deployment by introducing a fine-grained, event-driven execution model that abstracts away infrastructure management. Its on-demand nature makes it especially appealing for latency-sensitive and bursty workloads. However, the cold start problem—where the platform incurs significant delay when provisioning new containers—remains the Achilles’ heel of such platforms. This paper presents a predictive serverless scheduling framework based on Model Predictive Control (MPC) to proactively mitigate cold starts, thereby improving end-to-end response time. By forecasting future invocations, the controller jointly optimizes container prewarming and request dispatching, improving latency while minimizing resource overhead. We implement our approach on Apache OpenWhisk, deployed on a Kubernetes-based testbed. Experimental results using real-world function traces and synthetic workloads demonstrate that our method significantly outperforms state-of-the-art baselines, achieving up to 85% lower tail latency and a 34% reduction in resource usage.
TL;DR
Serverless computing’s biggest weakness is the "cold start"—the massive latency spike when a new container must be initialized. This paper introduces a proactive scheduler using Model Predictive Control (MPC) that forecasts future traffic to jointly optimize container prewarming and request dispatching. The result is a dramatic reduction in tail latency and a significant boost in resource efficiency.
What Problem Does This Paper Address?
In the world of Function-as-a-Service (FaaS), developers love the "scale-to-zero" model because they only pay for what they use. However, if a request arrives and no "warm" container is ready, the platform must provision a new one, load dependencies, and initialize the runtime. For heavy applications like machine learning (e.g., TensorFlow), this "cold start" can take 10 seconds or more—nearly 40x longer than the actual execution time.
Existing solutions usually fall into two camps: they either keep containers warm for a fixed window (which is wasteful) or try to predict traffic but fail to coordinate those predictions with how requests are actually admitted into the system. The authors identify a missed opportunity: request shaping. Sometimes, it is faster to make a request wait a few milliseconds for a busy container to finish than to trigger a 10-second cold start.
Methods
The authors propose a predictive framework built on Model Predictive Control (MPC). Unlike reactive schedulers, MPC looks at a "receding horizon"—it predicts what will happen over the next several time steps and makes a plan, but only executes the first step before recalculating.
Key components include:
- Fourier-based Forecasting: The system uses Fourier transforms to identify periodic patterns in function invocations. This is more robust than traditional ARIMA models for the bursty, shifting nature of cloud workloads.
- The MPC Optimizer: This is the "brain" that solves a constrained optimization problem at every control interval. It balances three competing costs: latency (cold starts and queue waits), resource usage (overprovisioning), and system stability.
- Request Shaping: This is the novel "secret sauce." The scheduler can choose to briefly buffer incoming requests in a queue if it predicts a warm container will become available soon, effectively "shaping" the traffic to avoid unnecessary cold starts.
- Middleware Implementation: The system was implemented as a middleware layer for Apache OpenWhisk, meaning it can be deployed on standard Kubernetes clusters without modifying the core serverless platform.
Key Results
The MPC-based scheduler was benchmarked against the OpenWhisk default policy and "IceBreaker" (a state-of-the-art predictive baseline). The results highlight significant improvements across various latency metrics.
- Tail Latency: Achieved up to 85% lower 90th percentile latency on bursty synthetic workloads.
- Resource Usage: Reduced the total number of warm containers by 34.8% for Azure traces.
- Keep-alive Duration: Cut the duration containers spent sitting idle by up to 64.3%, drastically lowering the "hidden costs" of serverless.
- Predictive Accuracy: The Fourier-based model achieved 86.2% accuracy on real-world traces, outperforming traditional time-series models.
Key Insights and Ideas
- Coordination is King: Prewarming containers is only half the battle. By coordinating prewarming with request dispatching, the system ensures that requests and warm containers meet at the right time.
- The Power of "Wait a Moment": The paper proves that short, strategic deferrals of request dispatching (guided by predictive logic) can significantly reduce cold starts without degrading the user experience.
- Efficiency and Performance aren't a Zero-Sum Game: Usually, reducing latency requires over-provisioning. However, because the MPC controller is "aware" of the cost of keeping containers idle, it actually reduced the total number of warm containers used while also lowering latency.
Limitations and Future Work
- Forecast Sensitivity: The system’s effectiveness is tied to the accuracy of the forecast. In environments where traffic is completely random, the benefits of MPC become marginal.
- Manual Tuning: The "weights" in the MPC cost function were manually calibrated. Future versions should use automated online tuning to adapt these weights dynamically.
- Heterogeneous Focus: The current study assumes a homogeneous cluster. The authors plan to extend this to heterogeneous environments, where the scheduler must decide not just when to warm a container, but where.
Summary updated