Concurrence-concurrent网络应用必备

在寻找一个异步框架的时候,找到这个框架,Concurrence(http://opensource.hyves.org/concurrence/index.html)

 

 

Hello world:

 

 

 

Concurrence框架的目标是,提供一个更可用的编程框架,用以开发高性能的网络应用。

The goal of Concurrence is to provide an easier programming model for writing high performance network applications than existing solutions (Multi-threading, Twisted, asyncore etc).

特性:
  • Lightweight Tasks as the basic unit of execution.
  • Message passing as the basic unit of communication (between tasks).
  • Cooperative scheduling of tasks triggered by IO events and Timeouts.
  • Libevent based, always uses the most optimal asynchronous IO multiplexer for the given platform (epoll on linux, KQueue on BSD/OSX).
  • Fast low-level IO buffers implemented in Pyrex.
  • Socket API.
  • DBAPI 2.0 compatible MySQL driver implementation (native & asynchronous, with optimized protocol support written in Pyrex).
  • HTTP / WSGI Server.
  • HTTP Client.
  • Timeouts. All blocking API’s provide a timeout parameter.
  • Remoting. Message passing between tasks in diffent processes.

只是MySQL driver这个,就足够吸引我了。该死的python下只有一个driver。

 

安装也比较简单。(http://opensource.hyves.org/concurrence/index.html#download-installation)

 

 

有多高性能呢:

Benchmark of greeter.py (running with stackless python).

In this session it handled about 8300 request per second on 1000 concurrent connections:


    httperf --uri=/test --port=8080 --num-calls=1 --num-conns=100000 --rate=10000

    httperf --client=0/1 --server=localhost --port=8080 --uri=/test --rate=10000

        --send-buffer=4096 --recv-buffer=16384 --num-conns=100000 --num-calls=1


    Total: connections 98506 requests 98506 replies 98506 test-duration 11.815 s


    Connection rate: >> 8337.1 << conn/s (0.1 ms/conn, <=1022 concurrent connections)

    ...

    Request rate: >> 8337.1 req/s << (0.1 ms/req)

    Request size [B]: 64.0


    Reply rate [replies/s]: min 9707.9 avg 9850.2 max 9992.5 stddev 201.3 (2 samples)

    Reply time [ms]: response 8.0 transfer 0.0

    ...

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值