Allow servers to start with no background services #16693
+22
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enhances the
prefect server start
command to allow for:Which starts only the webserver and the "services" necessary for event processing (which aren't actual loop services).
I realized that
prefect server start
creates a single connection pool to the database that is shared across both the webserver and all running loop services; this seems problematic to me in high scale / high traffic situations - those connection pools have fundamentally different properties (timeout configuration, pool configuration, etc.).The eventual idea is to recommend pairing this new flag with a new CLI command
prefect services start
that starts only the background loop services. This allows users to easily decouple these two components of the backend, scale them independently, etc. and in the short term will allow us to see if there are differences in connection statistics between services and the webserver through the newPREFECT_SERVER_DATABASE_CONNECTION_APP_NAME
setting.