Prometheus threshold semantics #3035
-
Hi! Thanks a lot for Keda! I'm facing a scaling issue with the following scaledobject
I don't quite understand the 'threshold' semantics. My initial thought was that the However that seems to hold only up to the metric value of 11, then if there are 11 running replicas and the metric is 12.1, HPA reports 1.091/1 and refuses to scale to number of replicas 12. Appreciate any thoughts here! Thanks! EDIT Keda revision is 2.6.2
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
After playing with the Plus, as stated in documentation Prometheus scaler is working with average values only, also mentioned here: And the HPA scaling then follows this equation: Where |
Beta Was this translation helpful? Give feedback.
After playing with the
threshold
value, I found out it is the value that is set asdesiredMetricValue
of HorizontalPodAutoscaler (HPA)https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
Plus, as stated in documentation Prometheus scaler is working with average values only, also mentioned here:
#1881
And the HPA scaling then follows this equation:
desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )]
Where
desiredMetricValue
is thethreshold
in Prometheus scaler configuration.currentMetricValue
is then the value obtained from Prometheus (according toquery
) divided by the number of currently existing replicas.