Adaptive Warm-State Retention for Serverless Cold-Start Mitigation: Treating Keep-Alive Time as an Online Control Parameter
Sanjeet Raj Pandey, Axel Küpper
原文摘要
Serverless platforms are easy to operate but pay a recurring price in cold starts: when a function is called after sitting idle, its execution environment must be rebuilt before the request can run, and latency suffers. The usual fix keeps idle environments alive for a fixed window, but a single value rarely fits a changing workload: too high wastes idle capacity, too low causes avoidable cold starts. We argue the keep-alive window should not be a fixed deployment constant; instead we treat it as a per-function runtime parameter, adjusted online from what the system observes, kept separate from how many replicas to run. We build an external retention controller for OpenFaaS/faasd that needs no platform changes, driven by two simple agents: a reactive AIMD (Additive-Increase Multiplicative-Decrease) rule and a UCB1 multi-armed bandit. Against fixed-timeout baselines and a predictive histogram keep-alive, on steady, bursty, and trace-derived workloads (Huawei Serverless 2023), the bandit cuts the aggregate cold-start rate from 63% under immediate scale-to-zero to 3%, holds P95 tail latency at the level of the longest-retention fixed baseline, and uses about 13% less accumulated warm time than that baseline, while also beating the predictive baseline. No fixed timeout is best on every metric, whereas the adaptive agents reach a favorable operating point without manual tuning; on the bursty workload at a converged horizon the bandit's advantage is statistically significant. On a multi-node Kubernetes cluster under the platform's own Horizontal Pod Autoscaler, the controller coexists with an autoscaler it does not control: the replica count follows load identically across policies, and retention independently governs warm time.
cs.DC