5 ms·
Twisted.web vs Tornado, a Performance test
- davidw 17y agoWould be interesting to see mochiweb and a few other things thrown in there (maybe nginx for raw throughput).
- siong1987 17y agohttp://siong1987.com/eventmachinethin-vs-twisted-vs-tornado http://siong1987.com/eventmachinethin-vs-twisted-vs-tornado
- deleted 17y ago[deleted]
- coconutrandom 17y agoironically an article about web server performance just got hosed by HN.
- greut 17y agoGoogle Cache got it right before it melt down: http://74.125.77.132/search?q=cache%3Awww.apparatusproject.org%2Fblog%2F2009%2F09%2Ftwisted-web-vs-tornado-performance-test%2F http://74.125.77.132/search?q=cache%3Awww.apparatusproject.o...
- AndrewHampton 17y agoIt's back up.
- igorgue 17y agoup again sorry :)
- sophacles 17y agoSo my first thought on this Tornado stuff was: why not glue twisted and tornado together? A quick look at the code suggests it is doable, and could help fix the "web mess" in twisted. My second thought was: Why didn't they build this on libevent, and pyevent, which has a built-in non-blocking webserver which is pretty darned fast.
- PhilChristensen 17y agowhat 'web mess in twisted' are you referring to?
- illumen 17y agoThere are two web implementations, and neither are complete(eg, twisted.web does not support even http 1.1). Even the twisted developers will tell you they are not happy with the web code in twisted. twisted.web2 was the future and twisted.web was to be depreciated, now twisted.web is the future and twisted.web2 is to be depreciated... the mess is still being cleaned up. Link to the twisted web page describing the situation and the plan: http://twistedmatrix.com/trac/wiki/TwistedWebPlan http://twistedmatrix.com/trac/wiki/TwistedWebPlan
- igorgue 17y agothere is one implementation of twisted.web... twisted.web2 is merged, and what is not in twisted.web and is in twisted.web2 will not be used or will be merged in the future, there is no mess, you should just use twisted.web.
- moe 17y agoAs someone who tried using twisted.web just a few days ago I can add that yes, twisted.web seems reasonably complete but no, it is not a reasonable choice at this point for many reasons (mostly the common twisted reasons: callback hell and insufficient documentation). Imho the most interesting part about Tornado is not Tornado itself but the question it rubs into the face of the twisted evangelists: "Why didn't they just use the real twisted instead of re-inventing it?". This post suggests that they have at least heard the question and, ofcourse, immediately snapped into their long-practiced denial position ("Thou shalt not question the twisted way, we haz performance!"). Only this time twisted does not outperform the newcomer, which should give them food for thought.
- old-gregg 17y agoI wonder where standard Python's SimpleHttp server stands in there. I don't code Python much, but to me it seems that all these guys sit on top of Python's asyncore package, no?
- simonw 17y agoTornado has its own C wrapper around epoll ( http://github.com/facebook/tornado/blob/9e24ae162d024e4049b8811d7ca19e319c20021d/tornado/epoll.c http://github.com/facebook/tornado/blob/9e24ae162d024e4049b8... ), but falls back to select() if the wrapper can't be compiled.
- paul 17y agoIt will also use Python 2.6's native epoll (see line 326 of http://github.com/facebook/tornado/blob/9a8bd2fb6fd6279be16d6f0a2e57e49fe1b98f8f/tornado/ioloop.py http://github.com/facebook/tornado/blob/9a8bd2fb6fd6279be16d...)
- anotherjesse 17y agoI think Tornado is awesome since the applications you write can be read by normal people. While Twisted is powerful (and as the poster said, in the same magnitude of performance), it has a tough learning curve. Even if Tornado isn't successful, I think it just pushed the bar on how an async web framework can be written. I look forward to seeing other frameworks evolve as a response (I'm looking at you sinatra!).
- dlsspy 17y agoI find twisted relatively easy to work with. There's no particular reason tornado can't sit atop twisted. Hopefully I'll get some time to do that this weekend. The whole tornado vs. twisted thing is unfortunate, though. It exists in its current state because tornado is two different things: 1) a web framework 2) an async network stack. #2 exists in core python and in twisted. If we transplant #1 to twisted, then it should be just as easy to develop web apps on twisted, except you get a whole lot of stuff for free.
- moe 17y agoIf we transplant #1 to twisted, then it should be just as easy to develop web apps on twisted, except you get a whole lot of stuff for free. That would be... beyond awesome.
- dlsspy 17y agoFYI, I've pushed up some code. Unfortunately, tornado has no tests, so I'm absolutely certain it's not completely functional, but it works as far as I'm able to test a few things on localhost. http://github.com/dustin/tornado http://github.com/dustin/tornado I'd love some help, of course. :)
- moe 17y agoGlad you kicked this off. I'm not deep enough in twisted myself to contribute but I see others have already joined in - awesome!
- drawkbox 17y agoBoth twisted and Tornado are very fun to work on and I think it is great they are focused on performance. This is nothing but good for web frameworks in Python.
- WilliamLP 17y agoThe Deep Blue analogy is strained, now that Rybka 3 on a notebook computer will easily trounce the best human player in the world.
- antonovka 17y agoThe results are missing latency numbers for the concurrent requests, and there's no indication of the amount of work being done to handle a request, which will have a significant impact on load performance. That said, performance testing Python web server implementations seems bit like racing snails. If speed is why you're using Python, you're probably using the wrong tool.
- coolmenu 17y agoI see He test Tornado in MacBookPro, i think mac os dont have epoll, and tornado use select(). so i think he will test it in linux (2.6).
- KevBurnsJr 17y agoI've noticed some strange behavior with ab. Suggest testing with httperf as well.