计算机技术与发展2026,Vol.36Issue(6):200-206,7.DOI:10.20165/j.cnki.ISSN1673-629X.2026.0014
基于负载预测的K8s水平自动伸缩优化方法研究
Research on K8s Horizontal Pod Automatic Scaling Optimization Method Based on Load Prediction
摘要
Abstract
Kubernetes(K8s),a mainstream container orchestration platform,has been widely adopted in key areas such as cloud native and distributed systems.However,its native horizontal pod automatic scaling mechanism responds passively based on thresholds,resulting in significant scaling delays in the face of traffic bursts.This delay can easily lead to application performance bottlenecks and even service degradation,making it difficult to meet high availability and immediate response requirements.To effectively overcome this latency bottleneck and improve the proactive nature of automatic scaling,we propose a horizontal pod automatic scaling method based on load prediction for K8s.This method introduces an auxiliary container that deploys an LSTM model,working in conjunction with the target pod.This container processes the Prometheus monitoring metric stream in real time and uses LSTM to dynamically predict future short-term load trends.When the predicted value exceeds the warning threshold,the system proactively triggers scaling.Experimental results show that compared to the native HPA,the proposed method more accurately captures load changes,enabling proactive scaling and reduction.This mechanism significantly shortens application response time,improves system scaling efficiency and responsiveness,and avoids wasting server resources.关键词
Kubernetes/云原生/水平伸缩/负载预测/长短期记忆网络Key words
Kubernetes/cloud native/horizontal scaling/load prediction/LSTM分类
信息技术与安全科学引用本文复制引用
杨浩,沈硕,李瑞琪,王军,李荣达..基于负载预测的K8s水平自动伸缩优化方法研究[J].计算机技术与发展,2026,36(6):200-206,7.基金项目
甘肃省重点研发计划-工业类(23YFGA0010) (23YFGA0010)
国网甘肃省电力公司2025年科研成本项目(522723250008) (522723250008)