Autoscaling can prevent overload, but scaling down also frees resources and cuts costs. A Kubernetes HorizontalPodAutoscaler (HPA) adjusts an application's replica count based on CPU or memory usage. section 6.2.2
Figure 6.6 Basic autoscaling using the in-built k8s horizontal pod autoscaler (HPA). The HPA watches CPU and memory resources and will tell the deployment service to increase or decrease the number of replicas.
The HPA watches CPU and memory and directs the deployment to increase or decrease replicas. section 6.2.2
For LLM workloads, CPU and memory alone may not capture demand; GPU utilization can be a more relevant scaling metric. Using custom metrics requires additional services, such as DCGM for GPU metrics, Prometheus for monitoring, and a custom metrics API such as KEDA. section 6.2.2 section 6.2.2
Figure 6.7 Autoscaling based on a custom metric like GPU utilization requires several extra tools to work, including NVIDIA’s DCGM, a monitoring system like Prometheus Operator, and a custom metrics API like that provided by KEDA.
Custom-metric scaling adds a metrics exporter, monitoring system, and custom metrics API to the basic HPA setup. section 6.2.2


