aloof-scooter-47164
02/25/2026, 7:52 PMtall-airline-16756
02/25/2026, 7:52 PMtall-airline-16756
02/25/2026, 7:53 PMaloof-scooter-47164
02/25/2026, 7:55 PMtall-airline-16756
02/25/2026, 7:56 PMaloof-scooter-47164
02/25/2026, 8:06 PMtall-airline-16756
02/25/2026, 8:06 PMaloof-scooter-47164
02/25/2026, 8:13 PMtall-airline-16756
02/25/2026, 8:13 PMaloof-scooter-47164
02/25/2026, 9:08 PMtall-airline-16756
02/25/2026, 9:08 PMmetrics: type: Resource and name: cpu so it targets CPU utilization %.
1. Pick complementary thresholds
◦ LiveKit agent load threshold (default 0.7) means the server considers itself "busy" at ~70% CPU.
◦ Set HPA target lower than that so HPA starts adding pods before LiveKit hits its threshold. Common choice: HPA target = 50–60%.
◦ This gives headroom for pods to come up and cold-start before existing pods exceed 70–80%.
1. Validate with per-pod metrics
◦ Monitor actual container CPU usage in mCPU and as % of requests (average and P95/P99).
◦ Also monitor the LiveKit agent reported load value (if exposed) to confirm it tracks CPU utilization.
1. Optional: expose custom load metric (advanced)
◦ If you prefer autoscaling directly on LiveKit’s internal load metric, export it to a metrics endpoint (Prometheus) and use the HPA with custom/external metrics. This requires a metrics adapter and is more complex but gives exact parity.
Example HPA strategy (conceptual)
1. Pod spec
◦ resources:
requests: cpu: "500m" limits: cpu: "1500m"
1. HPA (CPU-based)
◦ target CPU utilization: 50% (this means scale when average usage across pods > 50% of 500m = 250m)
◦ minReplicas: 2
◦ maxReplicas: 5
Why this works
• With requests set, HPA % maps directly to the same denominator LiveKit uses (fraction of available CPU capacity). Setting HPA target below LiveKit’s busy threshold ensures autoscaling reacts early and avoids pods reaching 70–80% CPU.
What I recommend you do next
• If you want, share one of:
◦ Current pod CPU requests/limits and observed pod CPU (average and peak in mCPU or %).
◦ The value LiveKit exposes for the agent load (if you’re already scraping it).
I’ll convert those into concrete request/limit values and an HPA YAML snippet tuned to your actual metrics.
Would you like a ready-to-apply HPA and Deployment snippet based on the example values (500m/1500m, target 50%) or should I tune it to your real metrics?
Sources: Self-hosted deployments | LiveKit Documentation