Hacker News new | past | comments | ask | show | jobs | submit login
Decline of the Tornado Web Server - What happened? (google.com)
64 points by Soupy on Dec 10, 2010 | hide | past | favorite | 32 comments



This graph displays the average requests/second that the python tornado framework can handle graphed over time by commits. Very surprising and also a little concerning since I am relying on Tornado for my current projects. Just wanted to make sure that you all were made aware of this in case you are considering using Tornado for your own projects (although I have had nothing but positive experiences with it).

Source - http://groups.google.com/group/python-tornado/browse_thread/...


thanks for sharing.. its pretty awesome how you automated the test..

i would love to hear more from bitly folks or hipmunk folks about their experience on the performance.

I am big fan of tornado, ben and it's simplicity. I guess i will continue to use my old branch for now.


Just wanted to quickly clarify that I was not responsible for the test, all credit goes to Jacob on the tornado google group (http://groups.google.com/group/python-tornado/browse_thread/...). Sorry for the misunderstanding.


Thanks for mentioning this - I'm talking Steve/Chris into doing a tornado talk at pycon right this moment. This is great ammo.


I believe Steve was one of the bigger pushes for the stack context stuff too. Mailing list suggests so anyway.


The Tornado framework is AMAZING for its simplicity. It gives you ONLY the things you'll need and a just a little bit extra. It's really great.


Thanks for posting this. I'm eager to see Ben and others reply to this on the list.


Thats a great script you guys wrote! Any chance it's going to be open sourced? Would be really fun to play around with github projects!


Here we see the movement from "Only 200 lines of code! Does 8 jillion requests per second!" to "Does things correctly, works in the real world!". Welcome to life.


Looking at the data, it appears that the performance drops are related to the StackContext feature. This feature is a convenience and not about doing things correctly to work in the real world.

Because the very earliest versions of Tornado were used by real websites, it looks like the code that did 8 jillion requests per second worked well enough in the real world.


That's often true, but doesn't appear to be the case here. This was a simple case of making invasive changes without quantifying the performance effects.


Wow, didn't expect this to make the front page of HN. There's more context in the groups thread (http://groups.google.com/group/python-tornado/browse_thread/...), but the short version is that a change to abstract away some error handling with the python 'with' statement had a surprising performance impact. When used with the @contextlib.contextmanager decorator, the with statement is more than 25 times as expensive as a try/except statement.


It looks like you forgot to call the function in 'simple_catch'. Interestingly, if you do, manual_with_catch will actually be faster in the failing case. (A try:fn() finally: return True beats everything else in the failing case)


Ah, that makes a big difference. Thanks for the correction.


yeah, I didn't know HN still cared about Tornado. I thought I was the only one using it for production ...


You and FriendFeed, Hipmunk, Brizzly, Bitly (they recently built async mongodb driver for use with Tornado), Quora (for long polling), ...


This was the feedback from the twisted community when it launched. There were lots of issues they found in a cursory glance.

My complaint (and I heard the same complaint from a developer as recently as yesterday) was that they tossed away all compatibility with everything that existed in order to solve one specific problem. Then people tried to use it as a general solution.

I spent an hour or two soon after tornado was released figuring out how to take the good parts of tornado and the good parts of twisted and put them together for this reason: http://dustin.github.com/2009/09/12/tornado.html The result (without any attempt to optimize it) was a reducing in raw performance, but the ability to actually do ridiculous numbers of things you can't do in tornado even today.


Tornado solves the specific problem of building web applications. What compatibility was tossed in accomplishing this goal? As far as I can tell, Tornado is compatible with HTTP, HTML and other related web standards.

What are some of the things that you can do with your version of Tornado that I cannot do with regular Tornado?


* Use relational databases (the mysql samples shipped with tornado blocked all network traffic while mysql was performing a query).

* Use non-relational databases (I have a couchdb interface for twisted, and a blocking one for regular python, nothing for tornado)

* Use memcached (it's fast, but it blocks)

* Make long-lived streaming http requests (cited in my blog post)

* Spawn and communicate with subprocesses that might be not be instant

* Schedule periodic execution of events (including http requests)

* Run efficiently on BSDs and OS X

* Send email

* Do DNS lookups (important part of making service requests)

* Use work queues (beanstalkd, gearman, ampq, etc...)

These are things I do with twisted today (though I've got at least one app I've moved to node.js for small kind of small scripty sorts of thing).

Again, you can run arbitrary python code, but if it blocks, it stops all traffic from flowing and new connections from coming in.


All of these things are possible with Tornado by using simple blocking calls and running more than one instance of the Tornado application behind a reverse proxy. If one instance blocks, then there are other instances of the application to handle new requests.

FriendFeed uses Tornado with MySQL (I learned this from Brett Taylor's blog). It seems to work.


What a cool visualization! Between Github and a continuous integration benchmarking tool, you could generate this for any project. I would pay to have it.


Very cool. I'm using Tornado for my projects and I gotta say, I'm really enjoying the minimalism and design. I can dive into the source and tweak it fairly easily.

Recently I tweaked the templating engine to accept keyword arguments in a namespace for the {% include %} command. Anyone interested in my patch?


... i don't understand why people downvote sometimes. weird.

let's play a game. why would anyone downvote the parent comment?


I didn't down vote your original comment, but my reactions are

1) Off-topic, what does your template patch have to do with the decline in performance?

2) If your patch is useful, submit it back to Tornado, or setup a fork, then just post a link



The fact that Ben jumped on this, made changes, AND commited them in less than a day gives me a lot of confidence as a Tornado user.


Don't miss the graph/chart (in the 'Tornado Performance Trend' Google doc). Yet another Tornado (and node.js and Deft) benchmark available on http://www.deftserver.org


The link takes me to a Google Docs login page


In my case (already logged in) it just tells me I "do not have permission to access this spreadsheet".


Click on the link twice.

Google docs has some weird bug at the moment afaik which causes this.

(Worked for me the second click, probably some cookie set the first time).


Sorry about that, it appears like the document is getting hammered and is throwing some users to a login page or to a simplified spreadsheet view.


Image of the rendered graph (because it was going to raw data view due to how many people were viewing): http://imgur.com/YhTdg.jpg

The gray line represents the 2009 year marker.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: