forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up webserver boot time by delaying provider initialization (apa…
…che#19709) * Speed up webserver boot time by delaying provider initialization This drops the time to first request from 37s to 20s by making the following changes: - Don't pre-load the app when not in daemon mode. The purpose of the call to `cached_app()` was to ensure that any errors are reported on the terminal before it is detached to make failures more obvious to the user (which is a good feature). However the comment about "pre-warm the cache" was incorrect and did not happen -- since we run gunicorn by spawning a whole new process it doesn't share any state from the current python interpreter. - Don't load/initialize providers when only importing airflow.www.views As it was written it would load the providers hook's at import time. This changes it through a combination of cached properties and the existing `init_connection_form` function. (`extra_fields` is not set as a cached_property because of how FAB works -- it iterates over all attributes of the class looking for methods/routes and then looks at properties on it, meaning it would still access the property too early)
- Loading branch information
Showing
3 changed files
with
26 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters