Airflow DAG 可靠性与调度(重试、并发、队列与 Sensor)
关键实践与参数
- 任务重试:
retries 与 retry_delay;指数退避与最大重试窗口。
- 并发与队列:
dag_concurrency、max_active_runs 与队列隔离资源。
- Sensor:使用
ExternalTaskSensor/S3KeySensor 等阻塞型需 reschedule 模式降低占用。
- 失败通知:On-failure 回调与告警渠道;审计上下文记录。
验证方法
- 演练上游失败与延迟;观察 Sensor 与重试行为。
- 指标与日志:任务耗时、重试次数、队列堆积与 SLA 违约。
- 压测 DAG 并发;评估资源瓶颈与调度延迟。
注意事项
- 资源与连接管理;避免长时间持有数据库连接。
- 定期归档日志与任务元数据,控制存储成本。
- DAG 版本化与回滚策略,保障快速恢复。
基本
文件
流程
错误
SQL
调试
- 请求信息 : 2026-09-28 10:14:33 HTTP/2.0 GET : www.ybb.press/tutorial/1279.html
- 运行时间 : 0.415090s [ 吞吐率:2.41req/s ] 内存消耗:5,316.45kb 文件加载:115
- 查询信息 : 19 queries 2 writes
- 缓存信息 : 36 reads,3 writes
- 配置加载 : 80
- 会话信息 : SESSION_ID=2d514k0n2d6ot2dgrtn2ifa3p4
- [ BEHAVIOR ] Run Closure @app_init [ RunTime:0.000111s ]
- [ CACHE ] INIT File
- [ BEHAVIOR ] Run \addons\cms\Cms @app_init [ RunTime:0.009024s ]
- [ BEHAVIOR ] Run \addons\fastchat\Fastchat @app_init [ RunTime:0.000162s ]
- [ BEHAVIOR ] Run \addons\log\Log @app_init [ RunTime:0.000417s ]
- [ BEHAVIOR ] Run \addons\shop\Shop @app_init [ RunTime:0.003228s ]
- [ BEHAVIOR ] Run \addons\yunping\Yunping @app_init [ RunTime:0.000424s ]
- [ BEHAVIOR ] Run Closure @app_init [ RunTime:0.000579s ]
- [ BEHAVIOR ] Run app\common\behavior\Common @app_init [ RunTime:0.001340s ]
- [ LANG ] /www/wwwroot/yebinbing/thinkphp/lang/zh-cn.php
- [ BEHAVIOR ] Run app\common\behavior\Common @app_dispatch [ RunTime:0.000105s ]
- [ ROUTE ] array (
'type' => 'method',
'method' =>
array (
0 => '\\think\\addons\\Route',
1 => 'execute',
),
'var' =>
array (
'addon' => 'cms',
'controller' => 'archives',
'action' => 'index',
),
)
- [ HEADER ] array (
'x-forwarded-proto' => 'https',
'cf-visitor' => '{"scheme":"https"}',
'cf-ipcountry' => 'US',
'cf-connecting-ip' => '216.73.216.103',
'cdn-loop' => 'cloudflare; loops=1',
'user-agent' => 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])',
'accept-encoding' => 'gzip, br',
'accept' => '*/*',
'cf-ray' => 'a41f3c41be786c75-CMH',
'x-forwarded-for' => '216.73.216.103',
'host' => 'www.ybb.press',
'content-length' => '',
'content-type' => '',
)
- [ PARAM ] array (
'catename' => 'tutorial',
'id' => '1279',
)
- [ RUN ] think\addons\Route->execute[ /www/wwwroot/yebinbing/vendor/fastadminnet/fastadmin-addons/src/addons/Route.php ]
- [ LANG ] /www/wwwroot/yebinbing/public/../application/common/lang/zh-cn/addon.php
- [ BEHAVIOR ] Run app\common\behavior\Common @addon_begin [ RunTime:0.004243s ]
- [ LANG ] /www/wwwroot/yebinbing/addons/cms/lang/zh-cn.php
- [ DB ] INIT mysql
- [ VIEW ] /www/wwwroot/yebinbing/addons/cms/view/default/show_article.html [ array (
0 => 'config',
1 => 'user',
2 => 'site',
3 => '__CHANNEL__',
4 => 'isWechat',
5 => 'canonical_url',
6 => '__ARCHIVES__',
7 => '__MODEL__',
) ]
- [ SESSION ] INIT array (
'id' => '',
'var_session_id' => '',
'prefix' => 'think',
'type' => '',
'auto_start' => true,
)
- [ BEHAVIOR ] Run \addons\cms\Cms @view_filter [ RunTime:0.000454s ]
- [ BEHAVIOR ] Run \addons\shop\Shop @view_filter [ RunTime:0.000208s ]

0.417770s
发表评论 取消回复