arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.19705cs.SEcs.DC
收藏

用于Kubernetes上Node.js的预测自动扩展:降低延迟,合理容量

Predictive Autoscaling for Node.js on Kubernetes: Lower Latency, Right-Sized Capacity

Platformatic

Ivan Tymoshenko, Luca Maraschi, Matteo Collina

AI总结:

本文提出预测自动扩展算法,通过预测负载变化提前扩容,降低延迟并优化容量,优于HPA和KEDA。

摘要:

Kubernetes提供两种默认扩展路径,但均存在结构限制。水平Pod自动扩展基于CPU利用率,无法直接衡量事件循环饱和度:Node.js Pod可能排队请求并错过延迟SLO,尽管CPU使用率适度。KEDA扩展HPA,增加更丰富的触发器,包括事件循环指标,但继承相同的反应控制循环,只能在过载开始后才检测。当新Pod启动并吸收流量时,系统可能已降级。降低阈值会移动操作点但不改变动态:缩放器仍需响应已越过的值,以牺牲永久过分配。我们提出一种预测缩放算法,通过预测新容量准备时的负载位置,基于预测值主动缩放。实例级指标受缩放器自身行为破坏:添加实例会重新分布负载并改变每个指标,即使外部流量未变。我们发现操作集群级聚合,该聚合在缩放下近似不变,可消除此反馈循环,产生适合短期外推的稳定信号。我们定义了一个度量模型(一组三个函数,编码特定度量与缩放的关系)和一个五阶段管道,将原始、不规则定时、部分度量数据转换为干净的预测信号。在稳定斜坡和突发峰值的HPA和KEDA基准测试中,该算法在整个过程中保持实例级负载接近目标阈值。在稳定斜坡下,中位延迟为26ms,相比KEDA的154ms和HPA的522ms。

英文摘要:

Kubernetes offers two default paths for scaling Nodejs workloads, and both have structural limitations. The Horizontal Pod Autoscaler scales on CPU utilization, which does not directly measure event loop saturation: a Node.js pod can queue requests and miss latency SLOs while CPU reports moderate usage. KEDA extends HPA with richer triggers, including event-loop metrics, but inherits the same reactive control loop, detecting overload only after it has begun. By the time new pods start and absorb traffic, the system may already be degraded. Lowering thresholds shifts the operating point but does not change the dynamic: the scaler still reacts to a value it has already crossed, at the cost of permanent over-provisioning. We propose a predictive scaling algorithm that forecasts where load will be by the time new capacity is ready and scales proactively based on that forecast. Per-instance metrics are corrupted by the scaler's own actions: adding an instance redistributes load and changes every metric, even if external traffic is unchanged. We observe that operating on a cluster-wide aggregate that is approximately invariant under scaling eliminates this feedback loop, producing a stable signal suitable for short-term extrapolation. We define a metric model (a set of three functions that encode how a specific metric relates to scaling) and a five-stage pipeline that transforms raw, irregularly-timed, partial metric data into a clean prediction signal. In benchmarks against HPA and KEDA under steady ramp and sudden spike, the algorithm keeps per-instance load near the target threshold throughout. Under the steady ramp, median latency is 26ms, compared to 154ms for KEDA and 522ms for HPA.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑