【问题标题】:Maximum number of DAGs in Airflow and Cloud ComposerAirflow 和 Cloud Composer 中的最大 DAG 数量
【发布时间】:2021-01-27 09:12:54
【问题描述】:

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

如果这取决于多个因素(Airflow 基础架构配置、Composer 集群规格、每个 DAG 的活动运行次数等),那么影响这一点的所有因素是什么?

【问题讨论】:

    标签: airflow airflow-scheduler google-cloud-composer


    【解决方案1】:

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

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

    在 Cloud Composer here 中提供了有关如何执行此操作的有用指南。因此,一旦您在底层 GKE 集群中启用了自动缩放,并解锁了 Airflow 配置中指定的硬限制,那么最大任务数应该没有限制。

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

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

    【讨论】:

      【解决方案2】:

      这取决于您的气流允许的可用资源和执行器的类型。在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
      

      【讨论】:

        猜你喜欢
        • 2020-11-02
        • 1970-01-01
        • 2019-09-19
        • 2020-11-21
        • 1970-01-01
        • 2019-05-02
        • 2019-08-19
        • 1970-01-01
        • 2020-11-30
        相关资源
        最近更新 更多