Skip to content

Allow some services to not use a connection pool to the DB#1262

Merged
FlorianSW merged 2 commits intomasterfrom
ops/disable_connection_pool
Apr 7, 2026
Merged

Allow some services to not use a connection pool to the DB#1262
FlorianSW merged 2 commits intomasterfrom
ops/disable_connection_pool

Conversation

@FlorianSW
Copy link
Copy Markdown
Collaborator

Some services managed by supervisor do need the DB during startup only to make at most a handfull of queries (if even). However, because they're using a connection pool behind the scenes, the connections are kept in that pool for some time unnecessarily.

This commit adds a way to disable connection pooling with an environment variable. This env var is enabled for all services that currently use the DB during startup only.

Some services managed by supervisor do need the DB during startup only
to make at most a handfull of queries (if even). However, because
they're using a connection pool behind the scenes, the connections are
kept in that pool for some time unnecessarily.

This commit adds a way to disable connection pooling with an environment
variable. This env var is enabled for all services that currently use
the DB during startup only.
Copy link
Copy Markdown
Collaborator

@Fragger Fragger left a comment

Choose a reason for hiding this comment

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

This looks good to me. On a fresh crcon restart with this, I'm at 97 connections for 10 servers (all currently idle) vs the 147 I was the other day but that wasn't at a fresh restart. A fresh restart without this with 10 servers idle looks like around 127 connections.

@FlorianSW
Copy link
Copy Markdown
Collaborator Author

This looks good to me. On a fresh crcon restart with this, I'm at 97 connections for 10 servers (all currently idle) vs the 147 I was the other day but that wasn't at a fresh restart. A fresh restart without this with 10 servers idle looks like around 127 connections.

Yeah, the impact of this PR is small, but I would say still noticeable. And it is a quick win (not much work to do :D).

Signed-off-by: Florian <floriansw@t-online.de>
@FlorianSW FlorianSW merged commit 2a44e4c into master Apr 7, 2026
3 checks passed
@FlorianSW FlorianSW deleted the ops/disable_connection_pool branch April 7, 2026 13:19
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.

2 participants