CherryPy和并发 [英] CherryPy and concurrency

查看:789
本文介绍了CherryPy和并发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CherryPy为了通过WSGI提供一个python应用程序。

I'm using CherryPy in order to serve a python application through WSGI.

我尝试了基准测试,但似乎CherryPy只能处理10 req /秒。 无论我做什么。

I tried benchmarking it, but it seems as if CherryPy can only handle exactly 10 req/sec. No matter what I do.

建立一个简单的应用程式,暂停3秒钟,以准确判断发生了什么...我可以确认10 req / sec与python脚本使用的资源无关。

Built a simple app with a 3 second pause, in order to accurately determine what is going on... and I can confirm that the 10 req/sec has nothing to do with the resources used by the python script.

__

任何想法?

推荐答案

默认情况下,CherryPy的内置HTTP服务器将使用10线程的线程池。如果您仍在使用默认值,可以尝试在您的配置文件中增加此值。

By default, CherryPy's builtin HTTP server will use a thread pool with 10 threads. If you are still using the defaults, you could try increasing this in your config file.

[global]
server.thread_pool = 30




  • 请参阅cpserver文档

  • a href =http://web.archive.org/web/20110623153049/http://cherrypy.org/wiki/ServerAPI =nofollow noreferrer> archive.org旧文档的副本

    • See the cpserver documentation
    • Or the archive.org copy of the old documentation
    • 这篇关于CherryPy和并发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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