Airflow和Cloud Composer中DAG的最大数量

问题描述

在1个Airflow或Cloud Composer环境中可以运行的DAG数量最大吗?

如果这取决于几个因素(气流基础结构配置,Composer群集规格,每个DAG的活动运行次数等),那么哪些因素会影响此?

解决方法

我从Composer docs中发现Composer使用CeleryExecutor并在Google Kubernetes Engine(GKE)上运行它。

Airflow中的最大数目没有限制,它是可用资源(节点,CPU,内存)的函数,然后假设有可用资源,Airflow配置选项只是一个限制设置,它将成为瓶颈,必须进行修改。

关于如何在Cloud Composer here中执行此操作,有帮助的指南。因此,一旦您在基础GKE群集中启用了自动扩展,并解锁了Airflow配置中指定的硬限制,就不应限制最大任务数。

对于Vanilla Airflow,这取决于您在Airflow中使用的执行器,并且如果您使用KubernetesExecutor然后在K8s中处理自动缩放,则将更易于扩展。

如果您使用的是LocalExecutor,则可以通过增加分配给Airflow安装的资源(CPU,内存)来改善性能,以改善性能。

,

这取决于气流允许的可用资源以及执行器的类型。在airflow.cfg的[core]部分中定义了允许同时运行的最大任务和dag:

# The amount of parallelism as a setting to the executor. This defines
# the max number of task instances that should run simultaneously
# on this airflow installation
parallelism = 124

# The number of task instances allowed to run concurrently by the scheduler
dag_concurrency = 124


# The maximum number of active DAG runs per DAG
max_active_runs_per_dag = 500

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...