Hello Max Voloshyn, thank you for the quick follow-up and for providing the scaler configuration details, this really helps to narrow things down.
A couple of clarifications and next steps:
About messageAge Scaler:
You're absolutely right, there isn’t a native "messageAge" scaler available for Azure Service Bus in KEDA as of now. My earlier suggestion was more of a conceptual alternative that sometimes gets implemented via custom scalers or in other services where trigger-based execution models can handle message age/latency better. For Azure Container Apps + KEDA, we're currently limited to queue length-based metrics when using the Azure Service Bus scaler.
Analyzing Your Current Setup:
From your config:
- activationMessageCount: 0 — This defines when the app should "wake up" from scale-to-zero. So, even a single message should activate the app.
- messageCount: 1000 — This defines the scaling target; KEDA will scale linearly up to maxReplicas as the queue approaches this count.
However, with sporadic messages that arrive in small bursts (1-15 seconds apart) and get processed rapidly, it’s likely that:
- The queue rarely accumulates enough messages for the messageCount trigger to activate.
- KEDA may still miss messages during its polling intervals, especially at low queue lengths.
Recommended Actions:
The root cause seems to be a combination of a high polling interval and the messageCount being too large for your workload pattern. Based on this, here are the recommended adjustments:
- Lower the messageCount value: Since your queue processes messages quickly and doesn’t build up to high volumes, setting messageCount to something like 5 or 10 may help KEDA react more sensitively to incoming traffic.
- Reduce the pollingInterval further: Try setting it to 5s or 10s to catch those quick-arriving messages.
- Consider minReplicas: 1: If reducing polling intervals is not sufficient or if you need zero cold-start delays, this will keep an instance warm at all times.
Let me know if this helps. Happy to assist further. Thank You!