[Paper Review] Mitigating Cold Starts in Serverless Platforms: A Pool-Based Approach
The paper implements a pool of warm function instances in Knative Serving to reduce cold-start latency, achieving up to 85% reduction in P99 for a single-pod pool.
Rapid adoption of the serverless (or Function-as-a-Service, FaaS) paradigm, pioneered by Amazon with AWS Lambda and followed by numerous commercial offerings and open source projects, introduces new challenges in designing the cloud infrastructure, balancing between performance and cost. While instant per-request elasticity that FaaS platforms typically offer application developers makes it possible to achieve high performance of bursty workloads without over-provisioning, such elasticity often involves extra latency associated with on-demand provisioning of individual runtime containers that serve the functions. This phenomenon is often called cold starts, as opposed to the situation when a function is served by a pre-provisioned "warm" container, ready to serve requests with close to zero overhead. Providers are constantly working on techniques aimed at reducing cold starts. A common approach to reduce cold starts is to maintain a pool of warm containers, in anticipation of future requests. In this report, we address the cold start problem in serverless architectures, specifically under the Knative Serving FaaS platform. We describe our implementation leveraging a pool of function instances, and evaluate the latency compared to the original implementation, resulting in a 85% reduction of P99 response time for a single instance pool.
Motivation & Objective
- Motivate reducing cold-start latency in serverless (FaaS) platforms.
- Propose a pool-based warm pod strategy within Knative Serving to mitigate cold starts.
- Implement a pool as a Knative resource and integrate pod migration with autoscaling.
- Evaluate latency improvements against baseline Knative without a pool using simple and heavy initializations.
Proposed method
- Implement a pool as a Knative Custom Resource Definition (CRD) mirroring revision structure to manage warm pods.
- Modify Knative autoscaling to migrate pods from the pool to target revisions before spawning new pods.
- Migrate pods to target replicaSets by relabeling and activating metrics collection, then spawn new pods only for deficit.
- Measure performance with two apps (Go HTTP server and TensorFlow image classifier) on GCP, comparing cold vs warm starts.
- Conduct large-scale simulations using Pareto-interarrival traces to evaluate percentile latency improvements under various pool sizes.
Experimental results
Research questions
- RQ1How much does a pool of warm pods reduce cold-start latency (P95, P99, P99.5) for serverless functions?
- RQ2What is the impact of a single-pod pool on different workloads with varying application initialization overheads?
- RQ3How does pool-assisted autoscaling affect latency and migration time in Knative Serving?
- RQ4What are the resource and implementation overheads of adding a pool (LOC, migration time)?
Key findings
- One-pod pool reduces HTTP server cold start from 12.123s to 5.076s (σ 1.638, 1.055 respectively).
- One-pod pool reduces image classifier cold start from 39.25s to 7.458s (σ 1.475, 0.641 respectively).
- Pool enables up to ~85% reduction in P99 cold-start delay for a single instance pool (as stated in conclusion).
- Simulation shows P95 entirely eliminated for both short and long applications with one pod in the pool; P99 reduced by at least 50%.
- Migration of pooled pods to a target revision takes around 2 seconds; pool resource definition ~200 LOC; migration code ~350 LOC.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.