Make stuff to do things

Subscribe (?) Subscribe to RSS

Archive for September, 2009

Twisted.web vs Tornado, part deux

Published on September 17th, 2009 in Comments

The first time I conducted a performance test between Twisted.web and Tornado, the results were not very meaningful in retrospect.  I have three good reasons for redoing the performance tests:

  1. Apache Benchmark errors – the twisted.web test would crash ab once the concurrency reached a certain level, thus not revealing the real performance of twisted.web.
  2. Unrealistic server environment – I did test of my MacBookPro, not a dedicated server.
  3. Controversy – the ensuing conversation of twisted.web vs tornado warrants a more accurate test with better tools and hardware.

This time, I performed the test with the aid of my friend Travis (thank you!) using The Grinder, a legitimate load testing tool and several virtual machines from the Rackspace Cloud.  The servers were Ubuntu Jaunty 9.04 with 2GB or RAM and quad-core 2GHz processors.

The Grinder script that I used to conduct the test just did a simple request. The Grinder test and preferences are available for download. I changed the IP address in the Grinder test to switch between twisted.web and tornado. The following command was used to start the tests:

1
$ for i in 100 200 300 400 500 750 1000; do java -Dgrinder.threads=$i -cp grinder-3.2/lib/grinder.jar net.grinder.Grinder grinder.pref; done;

I used  the same, simple ”hello, world” response apps for twisted.web and tornado as I did for the previous test.  Each app was run as a single threaded application. I also used Python 2.6.2.

The raw data that resulted from The Grinder and html output from the GrinderAnalysis is available for download.

The following results were compiled into a spreadsheet from the GrinderAnalysis tool. The X-axis is an individual test that represents number of concurrent requests.  The Y-axis is the mean response time in milliseconds.  Lower mean response time is better.

Python HTTP Server Performance

Below are examples of the response times graphs (blue) that I used to compile the above spreadsheet.  The entire output from GrinderAnalytics is available for download, as mentioned above.  Transactions per second (TPS) is the graph in the green and is maximum number of iterations of the grinder test that successfully ran in a one second interval.

100 Concurrent Requests

twisted.web.perfTornado.perf

500 Concurrent Requests

twisted.web.perfTornado.perf

1000 Concurrent Requests

twisted.web.perfTornado.perf

Switch to our mobile site