celery / django-celery-beat

Celery Periodic Tasks backed by the Django ORM
Other
1.69k stars 429 forks source link

Avoid loading all celery beat entities on create/update django admin forms #407

Open matthieudesprez opened 3 years ago

matthieudesprez commented 3 years ago

Summary:

Exact steps to reproduce the issue:

  1. create 1M clocked schedules
  2. try to reach /admin/django_celery_beat/periodictask/add/
  3. 💥

Detailed information

Just run into this right now, we have a process that auto scheduled some tasks, and over the months it created more than a million clocked schedules. celery beat admin forms seem to try loading the whole list so it takes a long time to render and eventually times out on most server configurations.

auvipy commented 3 years ago

can you check the resource usage? if increasing server resources solve the issue to some extent?

matthieudesprez commented 3 years ago

I'm pretty sure it will, but then having more clocked schedules might definitely causes the same issue because they're all loaded to appear in the dropdown of the periodic task form.