3

I'm using Gunicorn to run my Flask website in production. It all works fine, but when deploying updates I always stop and start the server again. I now read about this reload flag which "restarts workers when code changes" which according to the docs is "intended for development". If I could use this in production it would prevent the need to stop & restart gunicorn when deploying.

What is the reason that I should not use auto-reload in production?

1
  • you don't need to restart kill -HUP does the job nicely Commented May 2, 2016 at 5:15

1 Answer 1

4

The reload flag can be used in production and basically it does the same thing you do manually when restarting gunicorn.

The basic reason not to use auto-restart in production is that you are compromising the reliability of the service to third parties, without any possibility of control from your part.

Imagine that your service is continuously updated with new code. Some of it might be buggy and break the user experience and you would have no way of preventing that. On the other hand, if you update the app multiple times during a day, your users would be potentially losing data/having a bad experience multiple times during the day.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.