Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
687 views
in Technique[技术] by (71.8m points)

Django: Do i have to restart celery beat, celery worker and Django gunicorn when new changes are uploaded to production server

I have a production server running Django application

Django server is run using gunicorn and nginx

pipenv run gunicorn --workers=1 --threads=50 --bind 0.0.0.0:8888 boiler.wsgi:application

celery worker is run using

pipenv run celery -A boiler worker

celery beat is run using

pipenv run celery -A boiler beat 

Now i have updated my model and few views on my production server (i.e pulled some changes using github)

Now inorder to reflect the changes should i restart all celery beat,celery worker and Django server gunicorn

or only celery worker and Django server gunicorn is sufficient

or only Django server gunicorn is sufficient

question from:https://stackoverflow.com/questions/65895125/django-do-i-have-to-restart-celery-beat-celery-worker-and-django-gunicorn-when

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you have made changes to any code that in one way or the other affects the celery tasks then yes, you should restart the celery worker. If you are not sure, a safe bet is to restart. And since celery beat tracks the scheduling of periodic tasks you should also restart it if you restart the workers. Of course, you should ensure there are no current tasks running or properly kill them before restarting. You can monitor the tasks using Flower


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...