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

Allow servers to start with no background services #16693

Merged
merged 2 commits into from
Jan 14, 2025
Merged

Allow servers to start with no background services #16693

merged 2 commits into from
Jan 14, 2025

Conversation

cicdw
Copy link
Member

@cicdw cicdw commented Jan 11, 2025

This PR enhances the prefect server start command to allow for:

prefect server start --no-services

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 new PREFECT_SERVER_DATABASE_CONNECTION_APP_NAME setting.

@cicdw cicdw added the enhancement An improvement of an existing feature label Jan 11, 2025
Copy link

codspeed-hq bot commented Jan 11, 2025

CodSpeed Performance Report

Merging #16693 will not alter performance

Comparing no-services (6ac8617) with main (00c8bb2)

Summary

✅ 2 untouched benchmarks

Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@cicdw cicdw merged commit 71099db into main Jan 14, 2025
45 checks passed
@cicdw cicdw deleted the no-services branch January 14, 2025 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants