|
|
Subscribe / Log in / New account

Facebook releases the "Tornado" web server

Facebook has announced the release of its Tornado web server under the Apache license. "Tornado is a relatively simple, non-blocking Web server framework written in Python, designed to handle thousands of simultaneous connections, making it ideal for real-time Web services. Tornado is a core piece of infrastructure that powers FriendFeed's real-time functionality, which we plan to actively maintain. While Tornado is similar to existing Web-frameworks in Python (Django, Google's webapp, web.py), it focuses on speed and handling large amounts of simultaneous traffic." The code can be had from tornadoweb.org.

to post comments

Pure Python?

Posted Sep 11, 2009 3:28 UTC (Fri) by moxfyre (guest, #13847) [Link] (3 responses)

That's really cool! I am a big Python fan and have used some of the Facebook APIs, and liked 'em.

But a high-performance web server in pure Python? Woah... seems like just the kind of situation where the memory and speed overhead of a dynamic language could slow things down. How do they pull that off? Anyone know any details?

Pure Python?

Posted Sep 11, 2009 4:34 UTC (Fri) by psykoyiko (guest, #23469) [Link] (2 responses)

Seems like it's an event driven design wrapped around Linux's epoll. The
rest is probably all Web-frameworky stuff and gravy. I'm looking forward to
giving it a shot.

Pure Python?

Posted Sep 11, 2009 5:22 UTC (Fri) by zlynx (guest, #2285) [Link] (1 responses)

You are probably right.

I have no doubt that a C or C++ server built along the same lines would be even faster, but it would be more difficult to write the code to produce the data to be served.

Pure Python?

Posted Sep 11, 2009 6:34 UTC (Fri) by drag (guest, #31333) [Link]

Maybe, maybe not. There is already a lot of highly optimized C being used in
that program, even if it is not apparent on the surface. Take numpy, which is
something entirely different and is a math library created for scientific
computing and is programmed by using python. Try telling those folks that
python is slow. :)

It all depends on the algorithms being used and the skill of the programmer.
There are a thousand ways to skin a cat in Python, but only a few of them
will have good performance and it takes a understanding of computer
architecture, algorithms, and python to find those out. High level
programming is a lousy substitution for skill and knowledge.

Facebook releases the "Tornado" web server

Posted Sep 11, 2009 17:00 UTC (Fri) by zooko (guest, #2589) [Link] (1 responses)

There is discussion on Bret Taylor's blog:

http://bret.appspot.com/entry/tornado-web-server

You can count me among those who are skeptical of his off-handed comment that Twisted is buggy
and "demo-quality software", considering that Twisted has extensive unit tests and a hard policy of
not changing code without accompanying unit tests, as contrasted with Tornado which, as far as I
can tell, has no unit tests whatsoever.

Facebook releases the "Tornado" web server

Posted Sep 12, 2009 20:50 UTC (Sat) by einstein (guest, #2052) [Link]

you can say that again!

Facebook releases the "Tornado" web server

Posted Sep 11, 2009 17:21 UTC (Fri) by zooko (guest, #2589) [Link] (3 responses)

There is discussion on Bret Taylor's blog: http://bret.appspot.com/entry/tornado-web-server

You can color me skeptical of his remark that he stopped using Twisted because it was buggy and
"demo-quality software", considering that Twisted has extensive unit tests and a hard policy of not
accepting any commits without accompanying tests, whereas Tornado appears to have no tests
whatsoever.

Facebook releases the "Tornado" web server

Posted Sep 12, 2009 20:50 UTC (Sat) by einstein (guest, #2052) [Link]

You can say that again!

Facebook releases the "Tornado" web server

Posted Sep 13, 2009 19:24 UTC (Sun) by njs (subscriber, #40338) [Link] (1 responses)

What I get from his comment was that he found twisted.web in particular to be unsuitable for his task (that seems plausible to me, twisted.web is not twisted's crown jewel, though hopefully this will spur people to catch it up with tornado), and then it wasn't worth bringing in twisted as a dependency just for the core polling loop, when writing a non-portable one is only maybe 50 lines of code. Plus some disorientation at the twisted way of doing things, which does seem overcomplex until you figure out which pieces of documentation to read and start trying to write multi-protocol servers.

Facebook releases the "Tornado" web server

Posted Sep 15, 2009 12:59 UTC (Tue) by jamesh (guest, #1159) [Link]

That isn't too surprising. The first thing that threw me was the choice between twisted.web and twisted.web2: the first is obsolete (or will become obsolete), while the other hasn't really moved forward and is missing a number of features from the original.

And the twisted.web.client code is fairly primitive, lacking support for keep alives among other things.

That said, I agree that the core twisted code would probably have made a good base.


Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds