StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Follow on

© 2025 StackShare. All rights reserved.

Product

  • Stacks
  • Tools
  • Feed

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  1. Stackups
  2. Application & Data
  3. Frameworks
  4. Frameworks
  5. Tornado vs gevent

Tornado vs gevent

OverviewComparisonAlternatives

Overview

Tornado
Tornado
Stacks530
Followers409
Votes167
GitHub Stars22.3K
Forks5.5K
gevent
gevent
Stacks260
Followers52
Votes0

Tornado vs gevent: What are the differences?

Introduction

In this article, we will discuss the key differences between Tornado and gevent, two popular frameworks used for building high-performance web applications in Python. These frameworks offer different approaches to handling concurrency and asynchronous programming, which can greatly impact the scalability and performance of web applications.

  1. Concurrency Model: Tornado utilizes a single-threaded, non-blocking I/O approach, also known as an event-driven concurrency model. It achieves high performance by using non-blocking socket operations and an event loop that efficiently handles multiple requests concurrently. On the other hand, gevent is based on the greenlet library and utilizes a cooperative multitasking model. It uses a combination of greenlets and a monkey-patched standard library to achieve concurrency, allowing developers to write blocking-style code that performs well under heavy load.

  2. Resource Usage: Tornado is known for its low memory footprint and efficient resource usage. Since it uses a single-threaded model, it can handle a large number of concurrent connections with a small number of threads. This makes it ideal for applications that require high scalability. In contrast, gevent creates a separate greenlet for each connection, which can lead to higher memory usage and potentially limit scalability in certain scenarios where a large number of connections are needed.

  3. Compatibility with Existing Libraries: Tornado is designed to work well with external libraries that are also built for non-blocking I/O, making it easier to integrate with existing asynchronous code. It provides integrations with popular libraries like SQLAlchemy, Redis, and others. On the other hand, gevent's monkey patching approach may cause compatibility issues with some existing libraries, as it modifies the behavior of standard blocking I/O calls.

  4. Community and Ecosystem: Tornado has a well-established and active community with extensive documentation, tutorials, and examples available. It has been widely adopted by companies and individuals for building scalable and high-performance web applications. Gevent, although not as popular as Tornado, also has an active community and ecosystem. It offers a range of libraries and tools specifically designed to work with the greenlet-based concurrency model.

  5. Development Paradigm: Tornado follows a more traditional callback-based programming paradigm, where developers need to write callback functions to handle asynchronous operations. It can be challenging to reason about complex control flow and handle error scenarios in this style of programming. Gevent, on the other hand, provides a more familiar synchronous programming style, allowing developers to write code that appears to be blocking but executes asynchronously under the hood.

  6. Third-party Integration: Tornado provides built-in support for HTTP server capabilities, including a high-performance web server, while gevent is primarily a concurrency library and does not come with an out-of-the-box HTTP server. However, gevent can be combined with other frameworks like Flask or Django to build complete web applications.

In summary, Tornado and gevent differ in their concurrency models, resource usage, compatibility with existing libraries, community and ecosystem support, development paradigms, and third-party integration capabilities. Both frameworks have their strengths and considerations, and the choice depends on the specific requirements and trade-offs of the project.

Share your Stack

Help developers discover the tools you use. Get visibility for your team's tech choices and contribute to the community's knowledge.

View Docs
CLI (Node.js)
or
Manual

Detailed Comparison

Tornado
Tornado
gevent
gevent

By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user.

It is a coroutine -based Python networking library that uses greenlet to provide a high-level synchronous API on top of the libev or libuv event loop.

-
Fast event loop based on libev or libuv; Lightweight execution units based on greenlets; API that re-uses concepts from the Python standard library (for examples there are events and queues); Cooperative sockets with SSL support; Cooperative DNS queries performed through a threadpool, dnspython, or c-ares; Monkey patching utility to get 3rd party modules to become cooperative; TCP/UDP/HTTP servers; Subprocess support (through gevent.subprocess); Thread pools
Statistics
GitHub Stars
22.3K
GitHub Stars
-
GitHub Forks
5.5K
GitHub Forks
-
Stacks
530
Stacks
260
Followers
409
Followers
52
Votes
167
Votes
0
Pros & Cons
Pros
  • 37
    Open source
  • 31
    So fast
  • 27
    Great for microservices architecture
  • 20
    Websockets
  • 17
    Simple
Cons
  • 2
    Event loop is complicated
Cons
  • 1
    Not native
Integrations
Python
Python
Django
Django
Python
Python

What are some alternatives to Tornado, gevent?

Node.js

Node.js

Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

NGINX

NGINX

nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. According to Netcraft nginx served or proxied 30.46% of the top million busiest sites in Jan 2018.

Rails

Rails

Rails is a web-application framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.

Django

Django

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Laravel

Laravel

It is a web application framework with expressive, elegant syntax. It attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, and caching.

.NET

.NET

.NET is a general purpose development platform. With .NET, you can use multiple languages, editors, and libraries to build native applications for web, mobile, desktop, gaming, and IoT for Windows, macOS, Linux, Android, and more.

ASP.NET Core

ASP.NET Core

A free and open-source web framework, and higher performance than ASP.NET, developed by Microsoft and the community. It is a modular framework that runs on both the full .NET Framework, on Windows, and the cross-platform .NET Core.

Apache HTTP Server

Apache HTTP Server

The Apache HTTP Server is a powerful and flexible HTTP/1.1 compliant web server. Originally designed as a replacement for the NCSA HTTP Server, it has grown to be the most popular web server on the Internet.

Symfony

Symfony

It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP..

Spring

Spring

A key element of Spring is infrastructural support at the application level: Spring focuses on the "plumbing" of enterprise applications so that teams can focus on application-level business logic, without unnecessary ties to specific deployment environments.

Related Comparisons

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot

Liquibase
Flyway

Flyway vs Liquibase