kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.38k stars 1.06k forks source link

RabbitMQ trigger not work correctly for mode MessageRate and sum operator #6110

Open abialas opened 1 month ago

abialas commented 1 month ago

Report

I am using trigger based on RabbitMQ and MessageRate as mode. As operation I am using sum and value is set to 150. RabbitMQ has 4 queues. When every queue has incoming message rate at 50/s (200/s in sum) then I would expect to have two instances and this works fine. However, when my traffic increase and every queue has message rate 100/s (400/s in sum) I would expect three instances but Keda scales it up to my max which is six.

Expected Behavior

When sum message rate is 400/s Keda should scale to three instances based on above setup.

Actual Behavior

When sum message rate is 400/s Keda scales to six instances.

Steps to Reproduce the Problem

1.ScaledObject definition:

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: scaled-object-name
  namespace: namespace
spec:
  scaleTargetRef:
    name: release-name
  cooldownPeriod: 60
  pollingInterval: 10
  minReplicaCount: 2
  maxReplicaCount: 6
  triggers:
    - type: rabbitmq
      metadata:
        queueName: ^prefix.*$
        mode: MessageRate
        value: "150"
        unsafeSsl: "true"
        useRegex: "true"
        operation: sum
      authenticationRef:
        name: authRef
  1. Rabbit with 4 queues every with message rate 100/s
  2. Deployment release-name is scaled to six instances.

Logs from KEDA operator

No response

KEDA Version

None

Kubernetes Version

None

Platform

Amazon Web Services

Scaler Details

RabbitMQ Queue

Anything else?

No response

abialas commented 1 month ago

Issue is even worse - I have increased max replicas to 10 instances and for 400/s un sum it scales up to 10 instances.