<p><ahref="http://www.tornadoweb.org/">Tornado</a> is an open source version of the scalable, non-blocking web server and tools that power <ahref="http://friendfeed.com/">FriendFeed</a>. The FriendFeed application is written using a web framework that looks a bit like <ahref="http://webpy.org/">web.py</a> or <ahref="http://code.google.com/appengine/docs/python/tools/webapp/">Google's webapp</a>, but with additional tools and optimizations to take advantage of the underlying non-blocking infrastructure.</p>
<p>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 <ahref="http://www.kernel.org/doc/man-pages/online/pages/man4/epoll.4.html"><code>epoll</code></a> or <code>kqueue</code>, 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 <ahref="http://www.kegel.com/c10k.html">C10K problem</a>.)</p>
<li><ahref="https://github.com/downloads/facebook/tornado/tornado-{{version}}.tar.gz">Download version {{version}}</a> (<ahref="/documentation/releases.html">release notes</a>)</li>
<p>See the <ahref="/documentation/index.html">Tornado documentation</a> for a detailed walkthrough of the framework.</p>
<h2>Installation</h2>
<p><b>Automatic installation:</b> Tornado is listed in <ahref="http://pypi.python.org/pypi/tornado">PyPI</a> and can be installed with <code>pip</code> or <code>easy_install</code>. Note that the source distribution includes demo applications that are not present when Tornado is installed in this way, so you may wish to download a copy of the source tarball as well.</p>
<p>The Tornado source code is <ahref="http://github.com/facebook/tornado">hosted on GitHub</a>. On Python 2.6 and 2.7, it is also possible to simply add the tornado directory to your <code>PYTHONPATH</code> instead of building with <code>setup.py</code>, since the standard library includes <code>epoll</code> support.</p>
<p><b>Prerequisites:</b> Tornado runs on Python 2.5, 2.6, 2.7 and 3.2.
<ul>
<li>On Python 2.6 and 2.7, there are no dependencies outside the Python standard library, although <ahref="http://pycurl.sourceforge.net/">PycURL</a> (version 7.18.2 or higher required; version 7.21.1 or higher recommended) may be used if desired.</li>
<li>On Python 2.5, PycURL is required, along with <ahref="http://pypi.python.org/pypi/simplejson/">simplejson</a> and the Python development headers (typically obtained by installing a package named something like <code>python-dev</code> from your operating system).</li>
<li>On Python 3.2, the <ahref="http://pypi.python.org/pypi/distribute">distribute</a> package is required. Note that Python 3 support is relatively new and may have bugs.</li>
<p>You can discuss Tornado and report bugs on <ahref="http://groups.google.com/group/python-tornado">the Tornado developer mailing list</a>. Links to additional resources can be found on the <ahref="http://github.com/facebook/tornado/wiki/Links">Tornado wiki</a>.