Web Serversintermediate

Gunicorn vs Uvicorn

Gunicorn vs Uvicorn compared for 2026: Gunicorn 27.0.1 (pre-fork WSGI server that now ships a native, stable ASGI worker and beta HTTP/2, MIT, UNIX) vs Uvicorn 0.54.0 (ASGI server with built-in multi-process workers and experimental HTTP/2, BSD-3-Clause, runs on Windows). Includes throughput, memory, malformed-request, lifespan-failure and h2c results from runs we did on the same machine, and a clear pick.

Quick Answer

The old advice was to run FastAPI with Gunicorn as the process manager and Uvicorn's worker inside it. In 2026 that is no longer the only sensible setup. Gunicorn 24.0 (January 2026) added a native ASGI worker, promoted to stable in 25.1, plus HTTP/2 on its gthread, gevent and ASGI workers, so Gunicorn can serve FastAPI with no Uvicorn at all. Uvicorn, meanwhile, has its own supervisor for --workers with rolling restarts, and added experimental HTTP/2 through the zttp parser in 0.53. On 22 November 2026 we ran the same FastAPI app on Uvicorn 0.54.0, Gunicorn 27.0.1's asgi worker and Gunicorn with uvicorn-worker, one worker on one core: all three served 6,700-7,900 JSON requests/s and about 1,900-1,950 req/s on a 100 ms async endpoint, inside run-to-run noise. The differences are elsewhere: Gunicorn rejected a duplicate Host header and a 9,000-byte request line that Uvicorn accepted, Uvicorn ran as a single 54 MB process, and with --workers 2 a failed app startup made Uvicorn exit with status 0. Pick Uvicorn for single-process containers, development and Windows; pick Gunicorn when you want one server for WSGI and ASGI apps, strict HTTP parsing, mature process control or HTTP/2 now.

Last updated November 22, 2026. Covers Gunicorn 27.0.1 (12 November 2026) and Uvicorn 0.54.0 (24 September 2026) with uvicorn-worker 0.4.0; documentation and release notes read on 22 November 2026, plus same-machine runs we did that day.

Feature comparison of Gunicorn vs Uvicorn
FeatureGunicornUvicorn
Licence & Maintainer
MIT; Benoit Chesneau and volunteer maintainers; benoitc/gunicorn ~10.7k GitHub stars
BSD-3-Clause; Kludex/uvicorn (moved from encode/uvicorn); ~11.1k GitHub stars
Latest Release (Nov 2026)
27.0.1 on 12 Nov 2026 (ASGI keep-alive fix); 27.0.0 on 10 Nov (stricter RFC 9112 parsing)
0.54.0 on 24 Sep 2026 (HTTP/2 trailers, 103 Early Hints); 0.53.0 on 14 Sep (experimental HTTP/2)
Python & Platforms
Python 3.10+, CPython and PyPy; UNIX only (POSIX systems and macOS)
Python 3.10+ (3.9 dropped in 0.40); Linux, macOS and Windows; uvloop and httptools not on Windows or PyPy
Process Model
Pre-fork: arbiter process plus N workers; default 1 worker or $WEB_CONCURRENCY
Single process by default; --workers N spawns supervised child processes (spawn, not fork)
App Interfaces
WSGI (sync, gthread, gevent, tornado) and ASGI (native asgi worker, stable since 25.1); uWSGI binary protocol for nginx uwsgi_pass
ASGI 3 and ASGI 2; WSGI via --interface wsgi (WebSockets disabled)
HTTP/2
Beta since 25.0 (h2 extra) on gthread, gevent and asgi; TLS ALPN, or h2c prior-knowledge / Upgrade for trusted peers (26.2)
Experimental since 0.53 via --http zttp --http2: TLS ALPN or prior-knowledge h2c; no Upgrade h2c
WebSockets
asgi worker; 16 MiB default message limit (websocket_max_message_size, 27.0)
websockets-sansio by default since 0.50, or wsproto; legacy websockets deprecated; --ws-max-size 16 MB
HTTP Parser
Pure-Python parser or optional C parser gunicorn_h1c (gunicorn[fast]), with identical accept and reject rules
httptools (C) or h11 (pure Python); zttp (Zig core) experimental
Event Loop
--asgi-loop auto (uvloop if installed), asyncio or uvloop
--loop auto, asyncio, uvloop or zuvloop (CPython 3.14+)
Process Control
TTIN/TTOU, HUP reload, max_requests + jitter, server hooks, gunicornc control socket (25.1), statsd
SIGHUP rolling restart (0.51), SIGTTIN/SIGTTOU, worker health check timeout, --limit-max-requests + jitter
Concurrency Limits
--worker-connections (default 1000) for asgi, gthread and gevent; --threads for gthread
--limit-concurrency (503 when exceeded, not queued); --backlog 2048
ASGI Lifespan
--asgi-lifespan auto/on/off; a failed startup stops gunicorn (27.0)
--lifespan auto/on/off; startup failures exit with code 3 (0.50)
Request Limits
limit_request_line 4094 bytes (414), header count and size limits (431), duplicate Host and Content-Type rejected
--h11-max-incomplete-event-size for h11; the settings page lists no request-line length limit
Other Features
Dirty arbiters (beta) for blocking or ML work, uWSGI protocol, Paste deploy, SSL, PROXY protocol
--reload with watchfiles, --uds and --fd binding, --proxy-headers with forwarded-allow-ips, --reset-contextvars, programmatic API
Versioning & Change Pace
Major versions 24.0 (Jan) to 27.0 (Nov) in 2026, breaking changes called out in release notes
0.x; frequent minor releases (0.41 to 0.54 in 2026)
Our Run: JSON GET, 1 worker, 1 core
asgi worker: 6,739-7,852 req/s, p99 10-12 ms; with uvicorn-worker: 7,021-7,715 req/s
7,434-7,550 req/s, p99 9-11 ms
Our Run: 100 ms async I/O, 200 clients
asgi worker: 1,891-1,921 req/s, p50 102 ms; with uvicorn-worker: 1,929-1,942 req/s
1,937-1,946 req/s, p50 101 ms
Our Run: memory (RSS)
1 worker: 83-87 MB (arbiter + worker); 2 workers: ~125 MB, 3 processes
1 process: 54-55 MB; --workers 2: ~124-138 MB in 4 processes (parent, helper, 2 workers)
Our Run: malformed requests
400 for Transfer-Encoding: identity, 400 for space before colon, 400 for duplicate Host, 414 for 9,000-byte URL
400 for Transfer-Encoding: identity, 400 for space before colon, 200 for duplicate Host, request with 9,000-byte URL reached the app (404)
Our Run: lifespan startup failure
Master stopped, 'Reason: Worker failed to boot', exit code 3 (asgi and uvicorn-worker)
Single process: exit code 3; --workers 2: parent stopped but exited 0

Gunicorn

Gunicorn (Green Unicorn) is a pre-fork HTTP server for Python on UNIX, ported from Ruby's Unicorn. An arbiter process owns the listening socket and manages a pool of worker processes; the worker class decides how each one handles requests: sync, gthread, gevent and tornado for WSGI apps, and since 24.0 (23 January 2026) a native asyncio asgi worker for FastAPI, Starlette, Quart and Django Channels, promoted from beta to stable in 25.1. Version 25.0 added beta HTTP/2, 26.2 added cleartext h2c behind trusted proxies, and 27.0 tightened HTTP/1.1 parsing to current RFCs. Gunicorn is MIT-licensed and volunteer-maintained; 27.0.1 was released on 12 November 2026.

Pros

  • One server for WSGI and ASGI apps: Django, Flask and FastAPI deploy with the same process manager, config file and signals
  • Native ASGI worker matched Uvicorn in our run: 6,739-7,852 JSON req/s on one core versus 7,434-7,550 for Uvicorn, and the same ~1,900 req/s on a 100 ms async endpoint
  • Strict HTTP/1.1 parsing: rejected a duplicate Host header and returned 414 for a 9,000-byte request line, both of which Uvicorn passed to the app
  • Mature process control: TTIN/TTOU to scale workers, HUP to reload, max_requests with jitter, server hooks, statsd and the gunicornc control socket
  • HTTP/2 today (beta) on gthread, gevent and asgi workers, over TLS or prior-knowledge or Upgrade h2c for trusted proxies
  • A failed ASGI lifespan startup stopped the master with exit code 3, which orchestrators read as a failed deploy

Cons

  • UNIX only; it does not run on Windows
  • Always at least two processes (arbiter plus worker): 83-87 MB for one worker in our run versus 54 MB for single-process Uvicorn
  • Fast-moving in 2026: four major versions (24 to 27) since January, including breaking changes such as removing the eventlet worker (26.0) and rejecting Transfer-Encoding values that do not end in chunked (27.0)
  • h2c prior-knowledge mode answers plain HTTP/1.1 from trusted peers with 400, so a local health check or load test can fail if you enable it carelessly
  • Some of its own docs lag: the ASGI comparison table still lists Uvicorn without process management or HTTP/2

Best For

Teams that run a mix of WSGI and ASGI services, deployments on VMs or bare metal that rely on signals and hooks for zero-downtime reloads, and anyone who wants stricter HTTP parsing or HTTP/2 between a proxy and the app.

Uvicorn

Uvicorn is a lightweight ASGI server for Python and the default way to run FastAPI and Starlette apps. A single Uvicorn process runs one asyncio event loop (uvloop when available) with the httptools or h11 HTTP parser and a WebSocket implementation; uvicorn[standard] installs the faster optional pieces. With --workers it starts child processes using spawn rather than fork and supervises them, restarting dead or stuck workers, scaling with SIGTTIN and SIGTTOU and, since 0.51, restarting workers one at a time on SIGHUP. Version 0.52 added an experimental HTTP/1.1 parser called zttp, and 0.53 experimental HTTP/2 on top of it. Uvicorn is BSD-3-Clause, now lives at Kludex/uvicorn, and 0.54.0 was released on 24 September 2026.

Pros

  • Simplest way to run an ASGI app: one command, one process, 54 MB for a single-worker FastAPI app in our run
  • Same throughput as Gunicorn's asgi worker in our run: 7,434-7,550 JSON req/s on one core and about 1,940 req/s on a 100 ms async endpoint
  • Built-in multi-process mode with health checks, rolling SIGHUP restarts and worker scaling, so Gunicorn is optional rather than required
  • Runs on Windows (spawn-based workers) as well as Linux and macOS
  • Excellent developer loop: --reload with watchfiles, programmatic uvicorn.run(), Unix sockets and file-descriptor binding
  • --limit-concurrency returns an immediate 503 above a set number of connections or tasks, a simple guard for memory

Cons

  • With --workers 2, a failing lifespan startup stopped the server but the parent exited with status 0 in our run (single-process mode exits 3), so a supervisor may think the deploy succeeded
  • httptools passed a duplicate Host header and a 9,000-byte request line through to the app; you need a proxy or app checks for those
  • HTTP/2 is experimental, needs the zttp package and does not support Upgrade h2c or WebSockets over HTTP/2
  • ASGI only in practice: WSGI mode exists but disables WebSockets, so Django or Flask services usually need a different server
  • Its own deployment docs still open by recommending gunicorn -k uvicorn.workers.UvicornWorker, a module they also mark as deprecated in favour of the uvicorn-worker package

Best For

Containers that run one process each and scale horizontally, FastAPI and Starlette services, local development with auto-reload, Windows hosts, and small deployments where an extra process manager is not worth it.

What changed in 2026: Gunicorn learned ASGI, Uvicorn learned process management

Most Gunicorn-versus-Uvicorn articles answer a 2022 question: Uvicorn was a fast single-process ASGI server, Gunicorn was a WSGI process manager, so production FastAPI meant gunicorn -k uvicorn.workers.UvicornWorker. Both halves of that have moved. Gunicorn 24.0, released on 23 January 2026, added a native asyncio ASGI worker with HTTP/1.1 keep-alive, WebSockets and the lifespan protocol, and 25.1 (13 February) promoted it to stable. 25.0 added beta HTTP/2 for the gthread, gevent and ASGI workers, 26.0 removed the eventlet worker and added an ASGI framework compatibility suite that the docs report passing 438 of 444 tests across Starlette, FastAPI, Quart, Litestar, BlackSheep and Django Channels, and 27.0 (10 November) tightened request parsing to RFC 9110 and 9112, including a breaking change: a Transfer-Encoding that does not end in chunked now gets 400. On the other side, Uvicorn's --workers mode has its own supervisor that restarts dead or unresponsive children, and 0.51 made SIGHUP restart workers one at a time without dropping requests. Uvicorn also deprecated its bundled Gunicorn worker classes in favour of the separate uvicorn-worker package. So there are now three realistic stacks: Uvicorn alone, Gunicorn's own asgi worker, or Gunicorn with uvicorn-worker.

What we measured on one core

On 22 November 2026 we installed Gunicorn 27.0.1 with the fast and http2 extras (gunicorn_h1c 0.6.14, h2 4.4.1), Uvicorn 0.54.0 with the standard extras (httptools 0.9.0, uvloop 0.23.0), uvicorn-worker 0.4.0 and FastAPI 0.165.0 on Python 3.13.18. The app had a JSON endpoint and an async endpoint that awaited asyncio.sleep(0.1). Each server ran one worker pinned to core 0 of a 2-vCPU sandbox, and autocannon 8.0.0 ran on core 1: 50 connections for 8 seconds against the JSON endpoint, then 200 connections against the sleep endpoint, in three alternating rounds. Uvicorn served 7,434-7,550 JSON req/s, Gunicorn's asgi worker 6,739-7,852 and Gunicorn with uvicorn-worker 7,021-7,715; p99 latency was 8-13 ms everywhere. On the sleep endpoint all three delivered 1,891-1,946 req/s with p50 of 101-102 ms, which is the theoretical ceiling of 200 clients each waiting 100 ms. In other words, on this hardware the server choice did not change throughput; your app code, worker count and database will. Gunicorn's docs report its asgi worker at about 95% of Uvicorn's rate for small requests on an Apple M4 Pro, which fits what we saw. These are short single-machine runs, not a benchmark suite.

Strictness, malformed requests and failure modes

The differences that did show up were about what each server lets through and how it fails. We sent raw requests to all three setups. A body with Transfer-Encoding: identity and a space before a header colon got 400 from everyone. A request with two Host headers got 400 from Gunicorn's asgi worker but reached the application on Uvicorn and on Gunicorn with uvicorn-worker, which uses Uvicorn's parser; Gunicorn 26.1 started rejecting duplicate Host and Content-Type because downstream components may disagree about which one counts. A 9,000-byte request line got 414 URI Too Long from Gunicorn, whose limit_request_line defaults to 4,094 bytes, while Uvicorn passed it to FastAPI, which answered 404. Behind a well-configured proxy these cases rarely reach the app server, but if the app server is exposed directly, Gunicorn's defaults are tighter. Failure handling also differed. With a lifespan handler that raised on startup, Gunicorn stopped the master with exit code 3 and 'Reason: Worker failed to boot', with either worker class. Single-process Uvicorn exited 3 as its 0.50 release notes describe, but with --workers 2 the parent logged that the child failed to start, stopped, and exited with status 0 in three out of three runs. A systemd unit or CI smoke test that checks the exit code would miss that.

Processes, memory and restarts

Gunicorn always runs an arbiter plus workers: with one asgi worker we measured 83-87 MB of resident memory for the pair, with two workers about 125 MB across three processes. Single-process Uvicorn used 54-55 MB, which is why it is the natural fit for Kubernetes pods that run one process each and leave scaling to replicas. With --workers 2, Uvicorn ran four processes, the parent, a multiprocessing helper and two workers, for 124-138 MB, so the multi-worker memory cost is similar. Both supervisors recovered from a killed worker quickly: after kill -9 on a worker, Gunicorn had a replacement process within 0.04 s and serving requests within 0.25 s, Uvicorn within 0.09 s and 0.45 s. The process-control surface differs more than the recovery speed. Gunicorn offers TTIN and TTOU to change worker counts, HUP to reload configuration and code, server hooks around fork and requests, statsd metrics, max_requests with jitter and, since 25.1, a gunicornc control socket to list, add or kill workers interactively. Uvicorn offers SIGHUP rolling restarts, SIGTTIN and SIGTTOU (not on Windows), a worker health-check timeout and --limit-max-requests with jitter. Uvicorn uses spawn instead of fork, which is what lets its multi-process mode work on Windows; Gunicorn is UNIX-only.

HTTP/2 between proxy and app, and the h2c trap

If you want HTTP/2 on the hop from your proxy to Python, Gunicorn is further along. Its HTTP/2 support is labelled beta but covers the gthread, gevent and asgi workers, over TLS with ALPN or, since 26.2, cleartext h2c by prior knowledge, by Upgrade, or both, accepted only from peers in forwarded_allow_ips. Uvicorn's HTTP/2 is experimental, needs pip install zttp and --http zttp --http2, supports TLS and prior-knowledge h2c, and does not support the Upgrade mechanism or WebSockets over HTTP/2. In our test both answered curl --http2-prior-knowledge with HTTP/2 and status 200. Then we hit a documented trap. With Gunicorn's --http2-cleartext prior-knowledge, a trusted peer that speaks HTTP/1.1 is refused with 400 'Invalid HTTP/2 connection preface' rather than downgraded, and 127.0.0.1 is trusted by default. Our HTTP/1.1 load test against that port reported a suspiciously high request rate because every response was a 400, and a plain curl health check would fail the same way. Use --http2-cleartext both if anything on the trusted network may still speak HTTP/1.1; that mode served our HTTP/1.1 Upgrade request over HTTP/2 and prior-knowledge clients alike. Uvicorn with --http2 served HTTP/1.1 and prior-knowledge HTTP/2 on the same port without extra settings.

Verdict

Pick Uvicorn when each container runs one process and your orchestrator handles scaling and restarts: it is one command, one 54 MB process in our run, it runs on Windows, and on a single core it was as fast as anything else we tried. Use it with --workers only if you also check that your supervisor notices failures, because a failed startup with two workers exited 0 for us. Pick Gunicorn when you run on VMs or bare metal and want a real process manager, when you serve both WSGI and ASGI apps, or when you want strict HTTP parsing and HTTP/2 between your proxy and the app now. For new FastAPI deployments on Gunicorn, try the native -k asgi worker first; it matched Uvicorn's worker in our run and removes a dependency. Keep uvicorn-worker (not the deprecated uvicorn.workers module) for apps that depend on Uvicorn-specific behaviour. Pin the Gunicorn version and read its release notes before upgrading: 2026 brought four major versions with breaking changes.

All Comparisons

Gunicorn vs Uvicorn — FAQ

Common questions answered from the comparison above

Do I still need Gunicorn to run Uvicorn in production?

No. Uvicorn's --workers mode supervises child processes, restarts dead or stuck ones and does rolling restarts on SIGHUP. Many container setups run a single Uvicorn process per pod. Gunicorn is still useful if you want its process control, hooks and signals, or run WSGI apps too.

Can Gunicorn run FastAPI without Uvicorn?

Yes, since Gunicorn 24.0. Run gunicorn main:app -k asgi; the native worker was promoted to stable in 25.1. In our single-core test it served the same throughput as Uvicorn, about 6,700-7,900 JSON requests per second.

Is Gunicorn or Uvicorn faster?

In our run they were the same within noise: 7,434-7,550 req/s for Uvicorn, 6,739-7,852 for Gunicorn's asgi worker and 7,021-7,715 for Gunicorn with uvicorn-worker on one core, and about 1,900 req/s each on a 100 ms async endpoint with 200 clients.

What replaced uvicorn.workers.UvicornWorker?

The uvicorn.workers module is deprecated; Uvicorn's docs point to the separate uvicorn-worker package, used as gunicorn -k uvicorn_worker.UvicornWorker. Gunicorn's native -k asgi worker is the other option.

Does Uvicorn work on Windows?

Yes. Uvicorn runs on Windows, and its --workers mode uses spawn rather than fork so it works there too, though uvloop and httptools are not available on Windows. Gunicorn is UNIX-only.

Do Gunicorn and Uvicorn support HTTP/2?

Gunicorn has beta HTTP/2 on its gthread, gevent and asgi workers, over TLS or cleartext h2c from trusted proxies. Uvicorn has experimental HTTP/2 through the zttp package with --http zttp --http2, over TLS or prior-knowledge h2c, without Upgrade h2c.

Get the next comparison by email

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.