一个很好的多线程Web服务器蟒蛇? [英] A good multithreaded python webserver?

查看:159
本文介绍了一个很好的多线程Web服务器蟒蛇?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找它是多线程的,而不是被多进程的一个python web服务器(如mod_python的情况下为Apache)。我希望它是多线程的,因为我想有一个内存对象缓存将由各种HTTP线程使用。我的网络服务器做了很多昂贵的东西,并计算一些大型阵列,需要在内存中缓存供将来使用,以避免重新计算。这是不可能的在多进程web服务器环境。存储内存缓存此信息也并不是一个好主意,因为该阵列大,它们存储在内存缓存会导致数据从内存缓存来除了IPC的额外开销的反序列化。

I am looking for a python webserver which is multithreaded instead of being multi-process (as in case of mod_python for apache). I want it to be multithreaded because I want to have an in memory object cache that will be used by various http threads. My webserver does a lot of expensive stuff and computes some large arrays which needs to be cached in memory for future use to avoid recomputing. This is not possible in a multi-process web server environment. Storing this information in memcache is also not a good idea as the arrays are large and storing them in memcache would lead to deserialization of data coming from memcache apart from the additional overhead of IPC.

我实现了使用BaseHttpServer,它提供性能良好的简单的网络服务器,但它得到了几个小时的时间后卡住。我需要一些更成熟的网络服务器。是否有可能到Apache配置为使用mod_python的一个线程模型下,这样我可以做一些对象缓存?

I implemented a simple webserver using BaseHttpServer, it gives good performance but it gets stuck after a few hours time. I need some more matured webserver. Is it possible to configure apache to use mod_python under a thread model so that I can do some object caching?

推荐答案

的CherryPy 。功能,从网站列出:

CherryPy. Features, as listed from the website:


  • 一个快速,HTTP / 1.1兼容的,WSGI线程池网络服务器。通常情况下,CherryPy的本身每页只消1-2MS!

  • 任何其他启用WSGI-Web服务器或适配器,包括Apache,IIS,lighttpd的,mod_python的,Fa​​stCGI的,SCGI和mod_wsgi的支持

  • 易于一次
  • 运行多个HTTP服务器(例如,在多个端口)
  • 为开发和部署都强大的配置系统

  • 灵活的插件系统

  • 缓存,编码,会议,授权,静态内容,以及更多
  • 内置工具
  • 一个土生土长的mod_python的适配器

  • 一个完整的测试套件

  • 可交换,可定制的...一切。

  • 内置分析,覆盖面和测试支持。

  • A fast, HTTP/1.1-compliant, WSGI thread-pooled webserver. Typically, CherryPy itself takes only 1-2ms per page!
  • Support for any other WSGI-enabled webserver or adapter, including Apache, IIS, lighttpd, mod_python, FastCGI, SCGI, and mod_wsgi
  • Easy to run multiple HTTP servers (e.g. on multiple ports) at once
  • A powerful configuration system for developers and deployers alike
  • A flexible plugin system
  • Built-in tools for caching, encoding, sessions, authorization, static content, and many more
  • A native mod_python adapter
  • A complete test suite
  • Swappable and customizable...everything.
  • Built-in profiling, coverage, and testing support.

这篇关于一个很好的多线程Web服务器蟒蛇?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆