liveBook · Manning

Pool

As explained in Data Pipelines with Apache Airflow, Second Edition

An Airflow pool is a named set of execution slots that limits the concurrency of tasks competing for a resource.

A pool protects a shared resource when parallel Airflow tasks could overwhelm it. Assign related tasks to a named pool, then set its fixed slot count to the concurrency the resource can support. section 12.4

Use pools to coordinate tasks competing for:

  • Databases that should not receive too many simultaneous queries. section 12.4
  • GPU systems or Spark clusters with limited processing capacity. section 12.4
  • High-resource tasks that need stricter limits than ordinary tasks. section 15.4.4

Assign a task to a pool

Create a pool through Airflow's Admin > Pools interface, give it a name and description, and choose its slot count. Then assign that pool when defining a task:\n\nPythonOperator(\n task_id="my_task",\n ...,\n pool="my_resource_pool"\n)\n\nWith 10 slots, the pool permits 10 tasks to access the resource simultaneously. When no slot is available, the scheduler postpones the task until one is released. section 12.4

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Explains slots, scheduler behavior, UI creation, task assignment, and interactions with broader concurrency limits.
Examples
Uses databases, GPUs, Spark clusters, default_pool, high_resource pools, and a PythonOperator assignment.
What you can do after
Operate/configure pools through the Airflow UI and assign tasks to named pools with suitable slot limits.
How it connects
Connects pools with the scheduler, tasks, DAG concurrency, global parallelism, default_pool, and CeleryExecutor worker concurrency.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.