将LocalExecutor
与MySQL
后端一起使用时,在我的CentOS 6 Box上运行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
...
这些不同于执行者流程,枪支大师和工程流程。使用SequentialExecutor
(sqlite
后端)运行它,只需启动一个调度程序过程。
气流仍然有效(DAGS正在运行),但是这些过程中的数量使我认为有问题。
当我在数据库中运行select * from job where state = 'running';
时,仅返回5个SchedulerJob
行。这是正常的吗?
是的,这是正常的。这些是调度程序过程。您可以使用以下参数在 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 file
中找到。SO 32 1 = 33您正在看到的过程。
希望这能解决您的疑问。
欢呼!
从v1.10.3开始,这就是我发现的。我的设置是:
parallelism = 32
max_threads = 4
总共有
- 1(main)
- 32(执行者)
- 1(dag_processor_manager)
- 4(DAG处理器)
= 38个进程!