nginx+paste 在生产环境中是否有效?
我在 Pylons(Python Web 框架)中开发了一个网站,并让它在我的生产服务器上的 Apache + mod_wsgi 下运行。
最近我听到了很多关于 nginx 的好消息,想尝试一下。目前,它作为转发代理运行以创建粘贴前端。它似乎运行得非常快......不过,我可能可以将其贡献给我,成为唯一访问它的人。
我想知道的是,Paste 在重负载下如何承受?我最好使用 nginx + mod_wsgi 吗?
I've developed a website in Pylons (Python web framework) and have it running, on my production server, under Apache + mod_wsgi.
I've been hearing a lot of good things about nginx recently and wanted to give it a try. Currently, it's running as a forwarding proxy to create a front end to Paste. It seems to be running pretty damn fast... Though, I could probably contribute that to me being the only one accessing it.
What I want to know is, how will Paste hold up under a heavy load? Am I better off going with nginx + mod_wsgi ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的应用程序将成为性能瓶颈,而不是 Apache 或 Paste。
Nginx 用于许多生产服务器,所以这一点就很好了。我不知道 mod_wsgi,但 uWSGI 用于生产环境,并且与 nginx 和 Paste 应用程序配合良好。
我目前使用 Apache + Paste 运行服务器,使用 Apache 提供静态内容并使用 Paste 处理 Pylons。当我对设置进行压力测试时(使用 Apache 上的默认设置),我发现处理请求所需的时间存在很大差异(从 0.5 秒到 10 秒不等)。
作为测试,我设置了 Nginx + uWSGI。众所周知,Nginx 非常适合处理静态内容,我发现它可以提供的文件数量提高了 10 倍。 Pylons 应用程序的平均响应时间没有变化(它受数据库限制),但变异性几乎降至零。
两个设置都没有断开连接或无法响应,因此基于此,我将在下一个应用程序中转向 Nginx + uWSGI,特别是因为它有更多的静态内容。
Your app will be the bottleneck in performance not Apache or Paste.
Nginx is used in lots of production servers so that bit will be fine. I don't know about mod_wsgi but uWSGI is used in production environments and plays well with both nginx and Paste applications.
I currently run a server using Apache + Paste using Apache to serve static content and Paste to handle Pylons. When I stress tested the setup (using default settings on Apache) I got a lot of variation in the time it took to handle requests (varying from 0.5 to 10 secs).
As a test I setup Nginx + uWSGI. Nginx is known to be very good for handling static content and I saw a 10x improvement in the number of files it could serve. The average response time for the Pylons app didn't change (it's DB bound) but the variability dropped to almost zero.
Neither setup dropped a connection or failed to respond so based on this I'll be moving to Nginx + uWSGI for our next app, especially as it has a lot more static content.