Skip to content

Make the scheduler Dag cache size and TTL configurable - #71816

Merged
jason810496 merged 2 commits into
apache:mainfrom
jason810496:feat/scheduler-dag-cache-config
Oct 19, 2026
Merged

jason810496 merged 2 commits into
apache:mainfrom
jason810496:feat/scheduler-dag-cache-config

Conversation

@jason810496

@jason810496 jason810496 commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

Why

The scheduler's cache bound landed in #71704 as a fixed constant. Deployments whose active Dag-version working set exceeds that limit cannot raise it, while memory-constrained deployments cannot lower it or choose time-based eviction.

How

The API server and scheduler read and validate their size and TTL pairs through component-specific helpers. Each component constructs CachedDBDagBag for every configuration. When both values are 0, the configured cache uses a plain unbounded dict and performs no eviction.

What

  • Adds [scheduler] dag_cache_size, defaulting to the existing LRU limit of 512 versions.
  • Adds [scheduler] dag_cache_ttl, defaulting to 0 with no time-based eviction.
  • Defines 0 consistently: size 0 disables size-based eviction, TTL 0 disables time-based eviction, and both 0 disable eviction for the process lifetime.
  • Documents the scheduler tuning guidance and the corresponding metrics.
  • Adds a feature newsfragment for the new scheduler settings.

Was generative AI tooling used to co-author this PR?

@uranusjr

uranusjr commented Sep 8, 2026

Copy link
Copy Markdown
Member

The API server and scheduler read and validate their size and TTL pairs through one helper.

This does not seem to be correct

A fixed 512-entry cache cannot fit every deployment: larger active working sets churn while memory-constrained schedulers may need a lower cap. Exposing size and TTL controls lets operators trade memory for refetch and deserialization cost while preserving the current defaults.
@jason810496
jason810496 force-pushed the feat/scheduler-dag-cache-config branch from c787d97 to 1b25146 Compare October 11, 2026 09:49
@jason810496
jason810496 requested a review from uranusjr October 13, 2026 21:02
@vatsrahul1001 vatsrahul1001 added the backport-to-v3-4-test Backport to v3-4-test label Oct 18, 2026
@jason810496
jason810496 merged commit d01d351 into apache:main Oct 19, 2026
79 checks passed
@jason810496
jason810496 deleted the feat/scheduler-dag-cache-config branch October 19, 2026 10:41
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

vatsrahul1001 pushed a commit that referenced this pull request Oct 19, 2026
…71816) (#75087)

* Make the scheduler Dag cache size and TTL configurable

A fixed 512-entry cache cannot fit every deployment: larger active working sets churn while memory-constrained schedulers may need a lower cap. Exposing size and TTL controls lets operators trade memory for refetch and deserialization cost while preserving the current defaults.

* Remove redundant scheduler Dag cache config fallbacks
(cherry picked from commit d01d351)

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
…71816) (#75087)

* Make the scheduler Dag cache size and TTL configurable

A fixed 512-entry cache cannot fit every deployment: larger active working sets churn while memory-constrained schedulers may need a lower cap. Exposing size and TTL controls lets operators trade memory for refetch and deserialization cost while preserving the current defaults.

* Remove redundant scheduler Dag cache config fallbacks
(cherry picked from commit d01d351)

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants