最广泛使用的 python Web 应用程序部署方式
我想知道哪个选项更稳定(抛开性能不谈)并且使用更广泛(我认为广泛使用的选项是最稳定的):
- apache -> mod_wsgi
- apache -> mod_fcgid
- apache -> mod_proxy_ajp
- apache ->; mod_proxy_http
用于一个项目,该项目将通过小型 json 格式的输入和输出消息以及网页提供 REST 服务,最高可达 100 req/s。如果您认为nginx等更合适,请评论apache。
谢谢。
I wonder which option is more stable (leaving performance aside) and is more widely used (I assume the widely used one is the most stable):
- apache -> mod_wsgi
- apache -> mod_fcgid
- apache -> mod_proxy_ajp
- apache -> mod_proxy_http
for a project that will serve REST services with small json formatted input and output messages and web pages, up to 100 req/s. Please comment on apache if you think nginx etc. is more suitable.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
apache
->mod-wsgi
是目前“推荐”的解决方案。但这也很大程度上取决于您的需求。运行 1 个重型应用程序与运行 1 个轻型应用程序或许多轻型应用程序之间存在很大差异。
就我个人而言,我的首选设置仍然是
nginx
->apache
->mod_wsgi
具有多个 apache 服务器,适用于重型站点。apache
->mod-wsgi
is currently the "recommended" solution. But it also depends on your needs quite a bit.There is quite a difference between running 1 heavy application versus 1 light aplication or many light applications.
Personally my preferred setup is still
nginx
->apache
->mod_wsgi
with multiple apache servers for heavy sites.如今,达到 100 个请求/秒并不难。
考虑您的框架推荐的部署。例如,Zope 内置了一个不错的网络服务器,因此 mod_proxy_http 是很好的部署。
自从wsgi取得成果后,它已经成为许多框架的首选机制,而它们现在内置的Web服务器只适合开发。
无论您现在部署什么,重要的是能够根据需要切换/添加堆栈的某些部分 - 您是否想要在某个地方为静态内容提供反向代理?如果您使用 nginx,您可能不需要它,因为它可以很好地提供来自 memcached 的静态内容。
总结:使用wsgi
100 req/s is not that hard to achieve these days.
Consider the deployment that your framework recommends. Zope for instance, has a decent webserver built in, so mod_proxy_http is good deployment.
Since wsgi came to fruition, it has become the preferred mechanism for many frameworks, and they now the builtin web servers are only suitable for development.
Regardless of what you deploy with now, it's important to be able to switch/add parts of the stack as necessary - do you want a reverse proxy for static content in there somwhere? You may not need one if you use nginx as it can serve static content from memcached quite well.
Summary: use wsgi