运行`airflow scheduler`启动33个调度程序进程

时间:2017-03-10 23:01:42

标签: python airflow

LocalExecutorMySQL后端一起使用时,在我的Centos 6框中运行airflow scheduler会创建33个调度程序进程,例如 deploy 55362 13.5 1.8 574224 73272 ? Sl 18:59 7:42 /usr/local/bin/python2.7 /usr/local/bin/airflow scheduler deploy 55372 0.0 1.5 567928 60552 ? Sl 18:59 0:00 /usr/local/bin/python2.7 /usr/local/bin/airflow scheduler deploy 55373 0.0 1.5 567928 60540 ? Sl 18:59 0:00 /usr/local/bin/python2.7 /usr/local/bin/airflow scheduler ... 这些与Executor进程和gunicorn master和worker进程截然不同。 使用SequentialExecutorsqlite后端)运行它只会启动一个调度程序进程 气流仍然有效(DAG正在运行),但这些过程的绝对数量让我觉得有些不对劲 当我在数据库中运行select * from job where state = 'running';时,只返回5 SchedulerJob行。 这是正常的吗?

2 个答案:

答案 0 :(得分:7)

是的,这是正常的。这些是调度程序进程。您可以使用 airflow.cfg

中的以下参数来控制此项
# 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

这些是从调度程序生成的,调度程序的pid可以在 airflow-scheduler.pid 文件中找到

所以你看到32 + 1 = 33个进程。

希望这能清除你的怀疑。

干杯!

答案 1 :(得分:0)

从v1.10.3开始,这就是我所发现的。我的设置是:

parallelism = 32
max_threads = 4

共有

  • 1(主)+
  • 32(执行者)+
  • 1(dag_processor_manager)+
  • 4个(dag处理器)

= 38个进程!