boundless-computer-27062
05/19/2026, 6:59 PMtall-airline-16756
05/19/2026, 6:59 PMtall-airline-16756
05/19/2026, 6:59 PMsum(...) by () values over time) for both livekit_egress_can_accept_request and livekit_egress_requests{type="room_composite"} from before, during, and after the burst? Patterns will confirm whether the sum scales linearly with replicas when idle.
2. Do you control the exporter/query layer (can you add recording‑active metrics or run recording‑count queries)?
3. Are you open to changing the KEDA trigger type to use a Prometheus query that returns a per‑cluster count (e.g., active recordings) or a ratio (active/total pods) rather than sum of per‑pod headroom?
Suggested approaches you can try now
• Use active-work queries: drive scaling from a metric that counts active recordings (e.g., sum(active_recordings)) so desired_replicas = ceil(active_recordings / capacity_per_pod). This is monotonic both up and down.
• Convert to a ratio: compute accepted_fraction = sum(can_accept_request==1) / count(pods); use AverageValue on that ratio or use metricType: AverageValue with a query that returns desired_replicas directly (e.g., ceil(sum(active_requests) / capacity_per_pod)). KEDA can also accept a query that returns a scalar representing desired replicas (depending on KEDA/Prometheus setup).
• Use external/advanced queries: create a Prometheus recording rule that emits a cluster‑level livekit_egress_cluster_available_slots = sum(can_accept_request) - desired_floor and then use that to drive scaling (so it does not grow with pods when idle).
• Keep CPU HPA for scale‑down: as you have, targetCPUUtilizationPercentage reliably drains because CPU is already per‑pod utilization rather than additive headroom.
If you want, share one Prometheus time series excerpt (question 1) and I’ll provide the exact PromQL to:
• Produce a cluster active recordings count, and
• A KEDA trigger/query that yields desired replicas (so HPA can both scale up and down).
Would you like me to craft those exact PromQL/KEDA ScaledObject snippets?
, with interactive elementsboundless-computer-27062
05/19/2026, 7:03 PMtall-airline-16756
05/19/2026, 7:04 PM