使用内部werkzeug开发服务器进行烧瓶部署(flask deployment using internal werkzeug development server)

编程入门 行业动态 更新时间:2024-10-27 16:35:04
使用内部werkzeug开发服务器进行烧瓶部署(flask deployment using internal werkzeug development server)

为什么不建议在生产中使用flask / werkzeug内部开发网络服务器 ? 会出现什么样的问题?

我问,因为在工作中我被迫这样做并使用make shift cron每天重新运行服务!

Why is it not recommended to use the flask/werkzeug internal development webserver in production? What sort of issues can arise?

I'm asking because in work I'm being forced to do so and use a make shift cron to re-run the service every day!

最满意答案

如果您每天必须使用cron作业来杀死并重新启动它,那么您已经发现使用Flask开发服务器的一个主要问题。 开发服务器不是为了稳定性,长寿命,可配置性,安全性,速度或开发过程中的便利性而编写的。

正确的WSGI设置将更快,正确处理多个连接,最重要的是,您可以定期重新启动应用程序进程,以清除可能累积的任何残骸。

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.

更多推荐

本文发布于:2023-07-24 00:16:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1239152.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:烧瓶   服务器   flask   werkzeug   development

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!