Optimizing Airflow Performance: Strategies, Techniques, and Best Practices
summary
Shows concrete fixes: moving an expensive top‑level API call into the task_flow API cuts DAG parsing from ~7s to ~2s, and deferring heavy imports (pandas/torch) trims parsing time by ~40%. Finds and removes unused indexes using pg_stat_statements and a size/scan query, freeing ~5GB from one index and preventing scheduler failures. Speaks about adding missing foreign‑key indexes to drop a year’s delete time from ~6 hours to 36s. Recommends pg_repack, VACUUM FULL and REINDEX for bloat and ongoing monitoring with pg_exporter.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 0:46DAG authoring best practices
- 2:09Optimizing DAG performance
- 5:45Database performance basics
- 7:05Managing unused indexes
- 9:01Automating index analysis
- 12:20Identifying missing indexes
- 13:37Slow query analysis
- 14:39Adding necessary indexes
- 15:24Understanding database bloat
- 18:11Mitigating database bloat
- 21:10Caveats and conclusions
