Kafka consumers scaling from zero with timed messages #4466
-
Say I have a scaler defined something like this: apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: my-scaler-1
spec:
scaleTargetRef:
name: my-statefulset-1
kind: StatefulSet
pollingInterval: 5
cooldownPeriod: 300
idleReplicaCount: 0
minReplicaCount: 1
maxReplicaCount: 10
triggers:
- type: kafka
metadata:
bootstrapServers: "kafka-broker-1.kafka-endpoints.svc.cluster.local:9092,kafka-broker-2.kafka-endpoints.svc.cluster.local:9092"
consumerGroup: MyConsumerGroup
topic: consumer.data
lagThreshold: "10000"
offsetResetPolicy: latest
activationLagThreshold: "1" The pods in Let's say the topic Now let's assume that the topic If a new record is added to the queue, after 1 hour; the scaler occasionally refuses to scale out, with no errors being logged, and status as "Scaling is not performed because triggers are not active" This behavior sticks even after the scaler is recreated. Hell even manually scaling the pod starts to scale it back down to zero. So any suggestions on what I may be missing? keda version: 2.10.0 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
What if you remove |
Beta Was this translation helpful? Give feedback.
-
Hey can someone help me with this We are encountering an issue with our KEDA scaled object triggers configuration. When there is a lag on the configured Kafka topic, the metrics value is being displayed as "673m" and "3122m" as the lag increases. Ideally, it should represent the number of messages, but it's being shown in this format. This issue is happening with the Kafka scaler when used in conjunction with CPU and memory metrics. However, when used separately, the Kafka scaler works as expected, showing the value as the number of messages. We need assistance in understanding why the values are represented in this manner and whether it's possible to use a combination of CPU, memory, and Kafka scalers, or if any modifications are needed in the configuration. Below is my scaled object configuration triggers:
HPA metrics output |
Beta Was this translation helpful? Give feedback.
Just use
minReplicaCount:0
&maxReplicaCount: 10
and removeidleReplicaCount
. It will properly scale between 0-10.idleReplicaCount
is only useful when you want to scale from 0 directly to some min value greater than 1.