views:

1194

answers:

4

Facebook just open-sourced a framework called Tornado.

What is it? What does it help a site do?

I believe Facebook uses a LAMP structure. Is it useful for smaller sites which are written under the LAMP stack?

+10  A: 

It looks like it is a web-server optimized for high-concurrency and high-scalability, but made for smaller payloads.

It was designed to support 10,000 concurrent users well.

The framework is distinct from most mainstream web server frameworks (and certainly most Python frameworks) because it is non-blocking and reasonably fast. Because it is non-blocking and uses epoll, it can handle thousands of simultaneous standing connections, which means it is ideal for real-time web services. We built the web server specifically to handle FriendFeed's real-time features — every active user of FriendFeed maintains an open connection to the FriendFeed servers. (For more information on scaling servers to support thousands of clients, see The C10K problem.)

It will run on a LMP stack, but it takes the place of Apache.

See the C10K problem.

John Gietzen
+3  A: 

I wonder how they're going to process blocking sql queries using this single-threaded non-blocking webserver...

Presumedly if you use blocking sql you should do it in a thread with pooling outside of the main server thread. Alternatively, don't use blocking SQL.
Aaron Watters
+1  A: 

It has 'database' module with blocking queries. Maybe they run multiple instances of this server to minimize blocking problems and maybe it is not used for whole friendfeed, only in some parts related to real-time behavior (i heard that HTTP connections persist open to check for updates, and threading behavior would be bad for this).

I don't think it is usable as general-purpose framework for any web applications.

kolen
A: 

Looking for an alternative (single threaded, asynchronous, event driven high performance web server) running on the JVM?

Deft web server

(Disclaimer: I'm a Deft committer)

Schildmeijer