BigData / Apache Airflow Interview Questions
What are Pools in Apache Airflow?
Pools are a mechanism to limit the number of concurrently running tasks that use shared resources (e.g., database connections, API rate limits). You define a pool with a maximum number of slots, and assign tasks to it. If all slots are occupied, queued tasks wait.
# Assign a task to a pool t = PythonOperator( task_id='my_task', python_callable=my_func, pool='limited_db_pool', # uses one slot from this pool pool_slots=1 )
Pools are created in the UI (Admin > Pools) or via the CLI: airflow pools set limited_db_pool 5 'DB connections pool'.
More Related questions...