Benchmark of Python web servers
nichol.as
nichol.as
It's true. I'm not sure if the first 30 seconds of any technical screencast can get any better than this:
http://www.zetadev.com/software/testosterone/screencast.html
* Some of the servers tested aren't designed to interact directly with clients over a network, and are meant instead to run proxied over a local socket behind something else like nginx. The benchmark is inconsistent in whether it actually does this, though, which makes the numbers useless for comparison purposes.
* Several of these servers use preforking architectures which assume the ability to have multiple workers available to service requests. Yet the benchmark deliberately limited them to only one worker, which makes the numbers useless for gauging actual peformance under concurrent load.
* Concurrent requests more than doubled
* Response times dropped 75%
* Error rate dropped 75%
It's amazing what a difference it makes to actually run something the way it was designed to run...
I admit that getting your head around configuration for the first time is an hour or two of staring at documentation, but once you get past that you'll love how simple it is. Getting it running under Apache via mod_wsgi is also a refreshing breeze.
Where Django is great for building websites, the beautiful transparency of CherryPy is excellent for building webservices (no cryptic errors).
We're using CherryPy with Routes, CouchDB, couchdb-python, couchdb-lucene, and lxml for a web annotation project and we couldn't be happier.
Also limiting its use to one worker is constraining any possibilities for concurrency in its responses. (grainbows built over gunicorn and using gevent or eventlet is better for that).
Some other servers in the tests have same kind of specifications.
I have been following the development of gevent lately, I am glad it did so well in these benchmarks.
That said, database access, network latency, caching, etc. are so important that you might as well just use the framework you like, then tune if required.