-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Adds new connection application name setting #16690
base: main
Are you sure you want to change the base?
Conversation
|
||
if self.sqlalchemy_max_overflow is not None: | ||
kwargs["max_overflow"] = self.sqlalchemy_max_overflow | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I added these kwargs into our connection pools for non-memory SQLite as well; I couldn't find any reason why we should avoid configuring the pool for a SQLite DB.
CodSpeed Performance ReportMerging #16690 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! A similar setting was proposed in #16374 also, so I'm sure this will be useful to users hosting their own server!
Co-authored-by: Alex Streed <[email protected]>
This PR exposes a new setting
PREFECT_SERVER_DATABASE_CONNECTION_APP_NAME
that allows users to specify an application name for connections opened to PostgreSQL databases. This allows us and users to hypothetically use different values for this field when running the webserver connection pools vs. the services connection pools (which are currently the same connection pool if usingprefect server start
but I want to experiment with a pattern where they are different).Running
SELECT application_name, datname, state, count(*) FROM pg_stat_activity group by datname, state, application_name order by count desc;
let's you see this field along with how many connections the given application has.Screenshot from running a single
prefect server start
command with no configuration:Screenshot from running
PREFECT_SERVER_DATABASE_CONNECTION_APP_NAME='foobartest' prefect server start
:Screenshot with another
PREFECT_SERVER_DATABASE_CONNECTION_APP_NAME='xxx' prefect server start --port 4300
: