On Astro, you can configure Celery executor in the following ways:
You can set these configurations per worker queue. With the Celery executor, you can configure multiple worker queues for different types of tasks and assign tasks to those queues in your Dag code.
The following document explains basic Celery executor configurations for a single worker queue. For instructions on how to configure multiple worker queues, see Create a worker queue.
The number of Celery workers running per worker queue on your Deployment at a given time is based on two values:
queued or running stateThe calculation is made based on the following expression:
[Number of workers]= ([Queued tasks]+[Running tasks])/(Concurrency)
Deployment parallelism is the maximum number of tasks that can run concurrently across worker queues. To ensure that you can always run as many tasks as your worker queues allow, parallelism is calculated with the following expression:
[Parallelism]= ([The sum of all 'Max Worker Count' values for all worker queues] * [The sum of all 'Concurrency' values for all worker queues]).
Kubernetes Event Driven Autoscaling (KEDA) computes these calculations every ten seconds. When KEDA determines that it can scale down a worker, it waits for five minutes after the last running task on the worker finishes before terminating the worker Pod.
When you push code to a Deployment, workers running tasks from before the code push don’t scale down until those tasks is complete. To learn more about how changes to a Deployment can affect worker resource allocation, see What happens during a code deploy.
For each worker queue on your Deployment, you have to specify certain settings that affect worker autoscaling behavior. If you’re new to Airflow, Astronomer recommends using the defaults in Astro for each of these settings.
In the Astro UI, select a Workspace, click Deployments, and then select a Deployment.
Click the Details tab and then click Edit in the Execution section to edit a worker queue.
Configure the following settings: