News for hackers. Stuff that matters.
Re:Twisted.web vs Tornado, a Performance test by coconutrandom on Friday September 11, 2009 @12:15PM (#817598)
ironically an article about web server performance just got hosed by HN.
Re:Twisted.web vs Tornado, a Performance test by greut on Friday September 11, 2009 @12:45PM (#817653)
Google Cache got it right before it melt down: http://74.125.77.132/search?q=cache%3Awww.apparatusproject.o...
Re:Twisted.web vs Tornado, a Performance test by AndrewHampton on Friday September 11, 2009 @12:47PM (#817658)
It's back up.
Re:Twisted.web vs Tornado, a Performance test by igorgue on Friday September 11, 2009 @12:47PM (#817657)
up again sorry :)
Re:Twisted.web vs Tornado, a Performance test by sophacles on Friday September 11, 2009 @11:52AM (#817547)
So 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.

Re:Twisted.web vs Tornado, a Performance test by PhilChristensen on Friday September 11, 2009 @12:24PM (#817616)
what 'web mess in twisted' are you referring to?
Re:Twisted.web vs Tornado, a Performance test by illumen on Friday September 11, 2009 @12:32PM (#817627)
There 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

Re:Twisted.web vs Tornado, a Performance test by PhilChristensen on Friday September 11, 2009 @01:49PM (#817761)
that's just not true. i use web1 extensively, and it works very well, and although it's performance is not as good as apache or lighttpd when serving raw files, it's more than adequate for most web application development.

web2 was never a formally released product, and most of the stuff that was only available in web2 (such as wsgi support) have now been backported. there was some confusion about this for awhile, but that was only ever a community issue, not a code-related one.

i primarily took issue with you calling it a "mess", i still think that's a rather inaccurate statement.

Re:Twisted.web vs Tornado, a Performance test by sophacles on Friday September 11, 2009 @03:23PM (#817942)
Specifically, from the outside looking in, exactly what you described is(was?) a mess. Last I looked it was confusing as to what I should use, what would be supported in the future, who (web or web2) had what feature, and what even worked. That was quite a while a go (like over a year). More recently, talk at pycon suggested things had not improved much, but I haven't verified that. I am open to the possibility that things have improved since I last looked, particularly given the overall quality of twisted stuff.

I still wonder tho, if this would be good to graft into twisted?

Re:Twisted.web vs Tornado, a Performance test by igorgue on Friday September 11, 2009 @01:08PM (#817689)
there 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.
Re:Twisted.web vs Tornado, a Performance test by moe on Friday September 11, 2009 @02:19PM (#817809)
As 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.

Re:Twisted.web vs Tornado, a Performance test by davidw on Friday September 11, 2009 @12:06PM (#817573)
Would be interesting to see mochiweb and a few other things thrown in there (maybe nginx for raw throughput).
Re:Twisted.web vs Tornado, a Performance test by siong1987 on Friday September 11, 2009 @11:53PM (#818606)
Re:Twisted.web vs Tornado, a Performance test by anotherjesse on Friday September 11, 2009 @12:50PM (#817664)
I 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!).

Re:Twisted.web vs Tornado, a Performance test by Rantenki on Friday September 11, 2009 @05:21PM (#818164)
I am shocked, SHOCKED I say, that nobody has brought up FapWS3 -> http://github.com/william-os4y/fapws3 , which runs about twice as fast for a "hello world" bench as Tornado, and wraps libevent for the async socket handling. As an added bonus, fapws3 can handle wsgi apps, django, etc...
Re:Twisted.web vs Tornado, a Performance test by dlsspy on Friday September 11, 2009 @01:28PM (#817730)
I 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.

Re:Twisted.web vs Tornado, a Performance test by moe on Friday September 11, 2009 @02:30PM (#817832)
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.

That would be... beyond awesome.

Re:Twisted.web vs Tornado, a Performance test by dlsspy on Saturday September 12, 2009 @01:24AM (#818674)
FYI, 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

I'd love some help, of course. :)

Re:Twisted.web vs Tornado, a Performance test by moe on Saturday September 12, 2009 @10:06AM (#818933)
Glad you kicked this off.

I'm not deep enough in twisted myself to contribute but I see others have already joined in - awesome!

Re:Twisted.web vs Tornado, a Performance test by dlsspy on Saturday September 12, 2009 @02:58PM (#819267)
You don't have to be deep into twisted. You can just try to make an app with it, or run a demo or something and let me know what works/fails.

As Tornado has no unit tests, it's difficult to see what's right or wrong without a human actually doing the work.

Re:Twisted.web vs Tornado, a Performance test by antonovka on Friday September 11, 2009 @07:18PM (#818326)
The 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.

Re:Twisted.web vs Tornado, a Performance test by old-gregg on Friday September 11, 2009 @12:50PM (#817663)
I 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?
Re:Twisted.web vs Tornado, a Performance test by simonw on Friday September 11, 2009 @12:56PM (#817672)
Tornado has its own C wrapper around epoll ( http://github.com/facebook/tornado/blob/9e24ae162d024e4049b8... ), but falls back to select() if the wrapper can't be compiled.
Re:Twisted.web vs Tornado, a Performance test by paul on Friday September 11, 2009 @02:39PM (#817841)
It will also use Python 2.6's native epoll (see line 326 of http://github.com/facebook/tornado/blob/9a8bd2fb6fd6279be16d...)
Re:Twisted.web vs Tornado, a Performance test by old-gregg on Friday September 11, 2009 @07:20PM (#818328)
Does this mean Python's own HTTPServer uses epoll starting v2.6?
Re:Twisted.web vs Tornado, a Performance test by paul on Saturday September 12, 2009 @01:38PM (#819185)
No, not that I'm aware of. It simply means that Python 2.6 makes the epoll system call available directly without need for a custom module.
Re:Twisted.web vs Tornado, a Performance test by drawkbox on Friday September 11, 2009 @02:48PM (#817859)
Both 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.
Re:Twisted.web vs Tornado, a Performance test by coolmenu on Friday September 11, 2009 @07:40PM (#818348)
I 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).
Re:Twisted.web vs Tornado, a Performance test by WilliamLP on Friday September 11, 2009 @04:41PM (#818088)
The Deep Blue analogy is strained, now that Rybka 3 on a notebook computer will easily trounce the best human player in the world.
Re:Twisted.web vs Tornado, a Performance test by KevBurnsJr on Saturday September 12, 2009 @04:53AM (#818773)
I've noticed some strange behavior with ab. Suggest testing with httperf as well.