flask deployment using internal werkzeug development server flask deployment using internal werkzeug development server flask flask

flask deployment using internal werkzeug development server


If you're having to use a cron job to kill & restart it on a daily basis, you've already found a major issue with using the Flask development server. The development server is not written for stability, longevity, configurability, security, speed or much of anything other than convenience during development.

A proper WSGI setup will be faster, handle multiple connections properly and, most importantly for you, periodically restart your app process to clean out any cruft that might build up.


I had a network call inside the response handler that had no timeout. Something went wrong and it was waiting for a while (I was using the requests module), and then apparently never recovered.

Since Werkzeug server had only one thread, the whole development server became completely unavailable.