Async Workers

You may also want to install Eventlet or Gevent if you expect that your application code may need to pause for extended periods of time during request processing. Check out the design docs for more information on when you’ll want to consider one of the alternate worker types.

  1. $ pip install greenlet # Required for both
  2. $ pip install eventlet # For eventlet workers
  3. $ pip install gunicorn[eventlet] # Or, using extra
  4. $ pip install gevent # For gevent workers
  5. $ pip install gunicorn[gevent] # Or, using extra

Note

Both require greenlet, which should get installed automatically, If its installation fails, you probably need to install the Python headers. These headers are available in most package managers. On Ubuntu the package name for apt-get is python-dev.

Gevent also requires that libevent 1.4.x or 2.0.4 is installed. This could be a more recent version than what is available in your package manager. If Gevent fails to build even with libevent installed, this is the most likely reason.