最近,我将 Airflow 从 1.9 升级到 1.10.3(最新版本)。
但是,我确实注意到与 SubDag 并发相关的性能问题。SubDag 中只能拾取 1 个任务,这不是应该的方式,我们对 SubDag 的并发设置为 8。
见下:
get_monthly_summary-214和get_monthly_summary-215是两个SubDag,可以由父dag并发在controller中并行运行
但是当放大 SubDag 时说get_monthly_summary-214,然后
你肯定可以看到一次只有 1 个任务在运行,其他的都在排队,一直这样运行。当我们检查SubDag并发时,实际上是我们在代码中指定的8:

我们确实设置了池槽大小,它是 32,我们确实有 8 个 celery worker 来接收排队的任务,我们与并发关联的气流配置如下:
# 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 = 32
# The number of task instances allowed to run concurrently by the scheduler …Run Code Online (Sandbox Code Playgroud)