Home > other >  what is the best way for heavy periodic tasks (django)
what is the best way for heavy periodic tasks (django)

Time:01-30

i have a django app that has more than 500 tables each table is for a device (each device sends 500 data every day and i store them in database).

i should get 10 minutes,hourly,daily,weekly, monthly averages and store them in another table called averages.

i don't know what is the best way for these periodic tasks. using django modules like celery-beat or using supervisor of the host?

thanks a lot.

CodePudding user response:

Both Celery and Supervisor can be used for periodic tasks in Django, it depends on the specifics of your use case.

If you have many tasks that need to be executed asynchronously, Celery is a good choice as it has a task queue and worker management system built in. Celery can also be used to schedule periodic tasks using the Celery Beat component.

If you have only a few periodic tasks, Supervisor can be simpler to set up and manage. Supervisor can be used to manage processes and can be configured to run your periodic tasks.

In general, if you have a larger, more complex system with many tasks, Celery is the better choice. If you have a smaller system with fewer tasks, Supervisor is a good option.

  • Related