Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize DAG run scheduling based on dataset triggers and batching #37707

Conversation

sunank200
Copy link
Collaborator

@sunank200 sunank200 commented Feb 26, 2024

This PR introduces optimizations to the dags_needing_dagruns method in the DagModel class. The changes include the implementation of batch processing to efficiently handle large sets of DAG IDs. The motivation behind this change is to address the performance issues associated with processing a large number of DAGs, which can lead to significant memory usage and slow down the scheduler.

Changes:

  • Batch Processing: The method now processes DatasetDagRunQueue records in batches, reducing memory usage and improving efficiency. This approach minimizes the overhead of loading and processing large numbers of DAGs simultaneously.
  • Error Handling: Improved the handling of cases where DAG serialization versions are outdated or when no dataset trigger records are found for a given DAG.

Depends on the merge of PR #37016. and #37101

Dependency Checklist


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@sunank200
Copy link
Collaborator Author

Based on conversation with @dstandish - we can park this PR and work on more pressing issue first

@sunank200
Copy link
Collaborator Author

Based on the conversation with @vatsrahul1001 this approach did not improve the performance hence not going ahead with this approach.

@sunank200 sunank200 closed this Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant