Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions airflow-core/newsfragments/55707.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Reduce default API server workers to 1

The default number of API server workers (``[api] workers``) has been reduced from 4 to 1.

With FastAPI, sync code runs in external thread pools, making multiple workers within a single
process less necessary. Additionally, with uvicorn's spawn behavior instead of fork, there is
no shared copy-on-write memory between workers, so horizontal scaling with multiple API server
instances is now the recommended approach for better resource utilization and fault isolation.

A good starting point for the number of workers is to set it to the number of CPU cores available.
If you do have multiple CPU cores available for the API server, consider deploying multiple API
server instances instead of increasing the number of workers.

* Types of change

* [ ] Dag changes
* [x] Config changes
* [ ] API changes
* [ ] CLI changes
* [ ] Behaviour changes
* [ ] Plugin changes
* [ ] Dependency changes
* [ ] Code interface changes
6 changes: 4 additions & 2 deletions airflow-core/src/airflow/config_templates/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1389,11 +1389,13 @@ api:
default: "8080"
workers:
description: |
Number of workers to run on the API server
Number of workers to run on the API server. Should be roughly equal to the number of
cpu cores available. If you need to scale the API server, consider deploying multiple API
servers instead of increasing the number of workers.
version_added: ~
type: integer
example: ~
default: "4"
default: "1"
worker_timeout:
description: |
Number of seconds the API server waits before timing out on a worker
Expand Down