加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

python – 用uwsgi替换nginx

发布时间:2020-12-13 21:32:17 所属栏目:Nginx 来源:网络整理
导读:似乎uwsgi能够做几乎我正在使用nginx的任何东西:提供静态内容,执行PHP脚本,托管python web应用程序, 所以(为了简化我的环境)我可以用uwsgi替换nginx uwsgi而不会损失性能/功能吗? 最佳答案 As they say in the documentation: Can I use uWSGI’s HTTP ca

似乎uwsgi能够做几乎我正在使用nginx的任何东西:提供静态内容,执行PHP脚本,托管python web应用程序,……
所以(为了简化我的环境)我可以用uwsgi替换nginx uwsgi而不会损失性能/功能吗?

最佳答案
As they say in the documentation:

Can I use uWSGI’s HTTP capabilities in production?

If you need a load balancer/proxy it can be a very good idea. It will
automatically find new uWSGI instances and can load balance in various
ways. If you want to use it as a real webserver you should take into
account that serving static files in uWSGI instances is possible,but
not as good as using a dedicated full-featured web server. If you host
static assets in the cloud or on a CDN,using uWSGI’s HTTP
capabilities you can definitely avoid configuring a full webserver.

所以,是的,uWSGI比传统的Web服务器慢.

除了性能之外,在一个非常基本的应用程序中,你是对的,uWSGI可以完成网络服务器提供的所有功能.但是,如果您的应用程序随着时间的推移而增长/变化,您可能会发现传统的Web服务器提供的内容很多,而uWSGI则没有.

我建议使用您选择的语言设置部署脚本(例如Python的Fabric).我会说我的网络服务器是部署和安装的最简单的组件之一.在我们的应用程序堆栈中设置,并且最不“需要” – 除非我正在配置新服务器,否则它很少在我的雷达上.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读