I usually go the Apache + mod_wsgi route. It is pretty easy to set up.
To answer your question about speed, I pulled this from the provided link:
The mod_wsgi module is written in C code directly against the internal Apache and Python application programming interfaces. As such, for hosting WSGI applications in conjunction with Apache it has a lower memory overhead and performs better than existing WSGI adapters for mod_python or alternative FASTCGI/SCGI/CGI or proxy based solutions.
不要沉迷于试图找出最快的网络服务器。这样做只会浪费你的时间。这是因为如果正确设置 Web 服务器,它们几乎永远不会成为瓶颈。真正的瓶颈是您的 Web 应用程序、数据库访问等。
因此,选择您认为满足您的一般要求并且易于设置和管理的任何 Web 托管系统。使用您理解且不需要投入大量时间的东西,意味着您可以将宝贵的时间集中在使应用程序性能更好上,从而减少真正的瓶颈。
Don't get carried away with trying to work out what is the fastest web server. All you will do in doing that is waste your time. This is because the web server is nearly never the bottleneck if you set them up properly. The real bottleneck is your web application, database access etc.
As such, choose whatever web hosting system you think meets your general requirements and which you find easy to setup and manage. Using something you understand and which doesn't require lots of time devoted to it, means you can then focus your valuable time on making your application perform better, thus reducing the real bottleneck.
Use Apache + mod_python. It's usually the easiest way and it performs very well.
Edit: additionally, as it turns out, it is also considered a dead project. So that might factor into your decision. That said, mod_wsgi is the preferred alternative.
您通常不仅仅服务于 Python,您还服务于基于 Python 的特定 Web 服务器或框架。例如。 Zope、TurboGears、Django、Pylons 等。虽然它们往往能够在不同的 Web 服务器后端上运行(有些本身提供内部 Web 服务器),但最佳解决方案将取决于您使用哪一个。
You don't usually just serve Python, you serve a specific web server or framework based on Python. eg. Zope, TurboGears, Django, Pylons, etc. Although they tend to be able to operate on different web server back-ends (and some provide an internal web server themselves), the best solution will depend on which one you use.
发布评论
评论(6)
我通常采用 Apache + mod_wsgi 路线。设置起来非常容易。
为了回答您有关速度的问题,我从提供的链接中提取了以下内容:
I usually go the Apache + mod_wsgi route. It is pretty easy to set up.
To answer your question about speed, I pulled this from the provided link:
不要沉迷于试图找出最快的网络服务器。这样做只会浪费你的时间。这是因为如果正确设置 Web 服务器,它们几乎永远不会成为瓶颈。真正的瓶颈是您的 Web 应用程序、数据库访问等。
因此,选择您认为满足您的一般要求并且易于设置和管理的任何 Web 托管系统。使用您理解且不需要投入大量时间的东西,意味着您可以将宝贵的时间集中在使应用程序性能更好上,从而减少真正的瓶颈。
Don't get carried away with trying to work out what is the fastest web server. All you will do in doing that is waste your time. This is because the web server is nearly never the bottleneck if you set them up properly. The real bottleneck is your web application, database access etc.
As such, choose whatever web hosting system you think meets your general requirements and which you find easy to setup and manage. Using something you understand and which doesn't require lots of time devoted to it, means you can then focus your valuable time on making your application perform better, thus reducing the real bottleneck.
您可以使用带有微框架(如 Bottle ,烧瓶)
You may use pure python wsgi server (see benchmark) with microframework (like Bottle, Flask)
使用 Apache + mod_python。这通常是最简单的方法,而且效果很好。
编辑:此外,事实证明,它也被认为是一个死项目。所以这可能会影响你的决定。也就是说,mod_wsgi 是首选替代方案。
Use Apache + mod_python. It's usually the easiest way and it performs very well.
Edit: additionally, as it turns out, it is also considered a dead project. So that might factor into your decision. That said, mod_wsgi is the preferred alternative.
Tornado 是一个令人印象深刻的高性能 Python Web 服务器。它有自己的框架,但速度/页面加载统计数据现在都是热门话题。
Apache2 和 WSGI 是我的另一个建议。
Tornado is an impressive high performance Python web server. It has it's own framework, but the speed/page load statistics are all the buzz right now.
Apache2 and WSGI is my other suggestion.
您通常不仅仅服务于 Python,您还服务于基于 Python 的特定 Web 服务器或框架。例如。 Zope、TurboGears、Django、Pylons 等。虽然它们往往能够在不同的 Web 服务器后端上运行(有些本身提供内部 Web 服务器),但最佳解决方案将取决于您使用哪一个。
You don't usually just serve Python, you serve a specific web server or framework based on Python. eg. Zope, TurboGears, Django, Pylons, etc. Although they tend to be able to operate on different web server back-ends (and some provide an internal web server themselves), the best solution will depend on which one you use.