1. Introduction
Kubernetes-native horizontal pod autoscalers react to CPU or memory thresholds but ignore the cost differential between cloud providers and instance families, often over-provisioning during traffic spikes. This work explores whether a learned scaling policy can jointly optimise for cost and latency across providers.
2. Methodology
A 12-service microservice benchmark (based on an open-source e-commerce reference application) was deployed across two Kubernetes clusters on separate cloud providers. A deep Q-network was trained over 3,000 simulated episodes using historical traffic traces, with state features including per-service request rate, current replica count, and spot-instance pricing, and actions corresponding to scale up, scale down, or migrate.
3. Results
The DQN policy reduced average hourly infrastructure spend by 27 percent relative to threshold-based HPA over a two-week evaluation window replaying production-like traffic, while 95th-percentile latency SLA violations remained at 1.6 percent, below the 2 percent target. Convergence was reached after approximately 1,800 training episodes.
4. Conclusion
Reinforcement learning provides a viable mechanism for cost-aware scaling decisions in multi-cloud settings without manual threshold tuning. Future work will incorporate carbon-intensity signals as an additional optimisation objective alongside cost and latency.
References
[1] Mnih V. et al., Human-level control through deep reinforcement learning, Nature, 2015. [2] Rossi F. et al., Horizontal and vertical scaling of cloud applications, IEEE CLOUD, 2019. [3] Qu C. et al., Auto-scaling web applications in clouds: A taxonomy and survey, ACM Computing Surveys, 2018.