Make stuff to do things

Subscribe (?) Subscribe to RSS

Posts Tagged ‘twisted.web’

Twisted.web vs Tornado Performance Test

Published on September 11th, 2009 in Comments

If you look about this blog, there have been a number posts about the twisted framework.  Dan, Igor, and I have been playing with txAMQP for sometime.  We’ve never run any twisted code in a high-scale production environment, we’re just enthusiasts.  So when I read the comments from the Tornado announcement and in the HackerNews thread, I asked #twisted.web on freenode:

“Who runs a large-scale production environment with twisted.web?”

The channel member responded that I speak to abstractbill since he’s written twisted code for justin.tv. He had already commented on hackernews and therefore, I already knew where he stood.  Users were asking and I just needed to see for myself:

“What’s the performance difference between Twisted.web and Tornado?”

So I performed the following tests using Apache Benchmark the same test that finiteloop used. However, I varied concurrent connections in addition to the benchmarked performance of requests per second.

The performance test was performed on my MacBookPro Intel Core Duo 2.4GHz, 4GB of RAM.  Each python webserver was run in one, single thread.  The code for the tests is available for Twisted.web and Tornado.  Both webservers  benchmarked by increasing the concurrent connections until the servers closed the connection and prevented ab from completing the test.

http_test_charthttpd_test_data

Tornado outperforms Twisted.web, but in the scale of those numbers the difference is negligible as finiteloop suggests.  What is noticeable is that after 50 concurrent connections, twisted.web’s webserver began to close the connection and not complete the test.

The results do not really stop me from wanting to continue using twisted.web, however there is some room for improvement in the twisted.web framework.  I applaud Facebook for releasing Tornado as open source and FriendFeed for create a really nice async webserver in python. I look forward to it’s continued development.

Switch to our mobile site