What about the performance of cogen.web.wsgi.WSGIServer?

2 views
Skip to first unread message

Yong Zhang

unread,
Mar 31, 2008, 4:14:44 AM3/31/08
to co...@googlegroups.com
ionel.mc,

What about the performance of your WSGIServer? Do you have some data? Is it suitable to use it in produciton now?

BR.
- yzhang

Ionel Maries Cristian

unread,
Mar 31, 2008, 2:41:33 PM3/31/08
to co...@googlegroups.com
Here's a the results of a ab benchmark comparing twisted and cogen:
http://code.google.com/p/cogen/source/browse/trunk/examples/bench.txt
running http://code.google.com/p/cogen/source/browse/trunk/examples/helloworld-wsgi-app.py
on 9001 (with cogen)
running http://code.google.com/p/cogen/source/browse/trunk/examples/tw.py
on 9002 (with twistedweb)
On short:
Requests per second with cogen: 928.98 [#/sec] (mean)
Requests per second with twisted: 1138.31 [#/sec] (mean)
Same document length, twisted runs on a epoll reactor, benchmarks
runned on the the same machine - i'll run the server and client on
different machines as soon as i get my hands on some new hardware.

I still work on the performance side at the moment - you'll see better
results in the future.

As for any asynchronous framework that isn't written almost completely
in C or C++ the sweet spot is low throughput, highly concurrent
server. That means a server that has a lot of connections but most of
them are waiting for events or data.

I wouldn't use it for anything very serious right now.
If you want a stable product, production tested and used by many
people, check out twisted.
If you like the coroutine idea and using generators to structure your
code check the inlineCallbacks feature
from defereds: http://twistedmatrix.com/documents/current/api/twisted.internet.defer.html#inlineCallbacks

If you still like cogen after these figures, you can check out the
trunk code (usually what's in trunk is the most stable - i have
unittests to check for regression).

--
ionel.

Reply all
Reply to author
Forward
0 new messages