The docs for listLength in the redis trigger are quite confusing. From reading around and experimenting it seems like listLength is the threshold over which a new pod should be created. Ie. if the listLength is 16, a pod will be spun up when there are 16 or more items in the given list.
How would i gaurantee that a pod (up to the maxReplicaCount threshold) will be spun up for every item in a list? The problem im having is that a number of pods get spun up (which can also be below the maxReplicaCount even when there are more elements in the list), over time the pods die and i end up with a couple of pods struggling with a long list, which makes this too unpredictable to use in production
What i really want is if i have a list length of 20, i am spun up 20 pods, if i have a maxReplicaCount of 20, all other list elements will be consumed by the existing pods but the 20 that exist will not spin down until the list length is below one PER pod.
According to my observation of the behavior of 'redis' scaler of KEDA with our app,
maxReplicaCount
,cooldownPeriod
, andlistLength
parameters relate to your question.listLength
is a trigger so that if you want 20 pods work for 20 list length, thenlistLength
is 1 to trigger for each queued task (but I am not sure if it is guaranteed becauselistLength
is just average value according to the doc).The situation of listLength=1 might be busy when one job is short-live because pod is created/terminated (after cooldownPeriod) for every queueing. Or, it might be reasonable when one job takes long time to process. (Just in our app case, I set
listLength
=5 to let one pod process several queued jobs in its event-loop. Another pod is created when list length reaches 5.)