What are the advantages of celerybeat over cron?

懵懂的女人 提交于 2019-12-10 17:18:44

问题


I see many people preferring celerybeat over cron jobs for periodic tasks. I see the documentation for celerybeat and I can see information on how to use it, but not why (or when) I should prefer it over cronjobs.

http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html#introduction


回答1:


I have used both and have come to the conclusion that beat is better at control than cron.

You can wire it up so that your control is via django admin instead of sshing in and changing the crontab. Also, there is an implicit portability when using beat - meaning you can move it from machine to machine by way of configuration instead of a login.

Of course, there are disadvantages as well but they are few. We used to use pid files to control the singleton aspect of a job but now we use a generic database semaphore table (other people have used memcache, but I just don't feel comfortable with that).



来源:https://stackoverflow.com/questions/16979248/what-are-the-advantages-of-celerybeat-over-cron

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!