maciej-gol / tenant-schemas-celery

MIT License
179 stars 36 forks source link

How to run CELERY_BEAT_SCHEDULE tasks at different intervals per tenant? #129

Open royroyee opened 5 days ago

royroyee commented 5 days ago

Is there a way to stagger CELERY_BEAT_SCHEDULE tasks so that they run at different times per tenant, instead of all tenants executing tasks simultaneously?

When tasks run at the same time across tenants, resource load increases significantly as the tenant count grows. Looking for a straightforward solution to vary task execution times per tenant without complex configurations or major structural changes.

Any guidance or examples on achieving this would be greatly appreciated

maciej-gol commented 4 days ago

Unfortunately, I'm not aware of any simple configuration for this :( I could look into this when I'm done implementing the DB scheduler for the tenants. What you are basically looking at is to add a jitter to every scheduler entry.