Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Tornado is a simple, fast python webserver and a micro web framework. Its provides the very basic framework to write a dynamic website. Its very easy to learn and extend to meet specific need of a demanding web application since it does not come in your way. The best part of using Tornado is it does not create thread per request so scales very nicely for large number of requests. I am using it for one of my project and loving it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top