Repaso
Español
Backend & APIsAdvancedAPI-27

A common starting point for the number of Gunicorn sync workers is…

Options

  1. 1 per server
  2. (2 × CPU cores) + 1 (Correct option)
  3. 100 per core
  4. Equal to RAM in GB

Answer

(2 × CPU cores) + 1

Why

Each sync worker handles one request at a time. More workers = more requests in parallel, but each uses memory and CPU.

The Gunicorn docs suggest (2 × cores) + 1 as a starting point (for 4 cores: 9 workers), then tune it with load tests.

For I/O-heavy apps, async workers (Uvicorn) or threads can handle many more connections.

Remember

Start with 2 × cores + 1, then measure.

Key terms

Practice this question in Repaso