Skip to content

Build go.dev Go Report Card Documentation Status License

Predictive Horizontal Pod Autoscaler

Visit the GitHub repository at https://www.github.com/jthomperoo/predictive-horizontal-pod-autoscaler to see examples, raise issues, and to contribute to the project.

What is it?

Predictive Horizontal Pod Autoscalers (PHPAs) are Horizontal Pod Autoscalers (HPAs) with extra predictive capabilities baked in, allowing you to apply statistical models to the results of HPA calculations to make proactive scaling decisions.

Why would I use it?

This autoscaler lets you choose models and fine tune them in order to predict how many replicas a resource should have, preempting events such as regular, repeated high load. This allows for proactive rather than simply reactive scaling that can make intelligent ahead of time decisions.

What systems would need it?

Systems that have predictable changes in load, for example; if over a 24 hour period the load on a resource is generally higher between 3pm and 5pm - with enough data and use of correct models and tuning the autoscaler could predict this and preempt the load, increasing responsiveness of the system to changes in load. This could be useful for handling different userbases across different timezones, or understanding that if a load is rapidly increasing we can prempt the load by predicting replica counts.

Features

  • Functionally identical to Horizontal Pod Autoscaler for calculating replica counts without prediction.
  • Choice of statistical models to apply over Horizontal Pod Autoscaler replica counting logic. * Holt-Winters Smoothing * Linear Regression
  • Allows customisation of Kubernetes autoscaling options without master node access. Can therefore work on managed solutions such as EKS or GCP. * CPU Initialization Period. * Downscale Stabilization. * Sync Period. * Initial Readiness Delay.