hyades icon indicating copy to clipboard operation
hyades copied to clipboard

On scaling api-server to multiple instances, same pod executes the tasks every time

Open VithikaS opened this issue 2 years ago • 1 comments

Api server has a task schedular which runs a job every minute (configurable) for parsing cron expressions of Scheduled Tasks and sends an event when a task is due in next minute.

When we scale api server to multiple instances, whichever pod is ahead in parsing cron expressions, will keep on sending events and same pod will keep acquiring lock. So load will not be evenly distributed across the pods.

Ideally, we should have tasks spread on pods evenly

VithikaS avatar Jul 28 '23 11:07 VithikaS

Just dawned on me that a simple solution to this could be to add a random jitter to scheduled tasks.

nscuro avatar Sep 10 '24 17:09 nscuro