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

fix db connection pool #1529

Merged
merged 2 commits into from
Jan 13, 2025
Merged

fix db connection pool #1529

merged 2 commits into from
Jan 13, 2025

Conversation

terrazoon
Copy link
Contributor

@terrazoon terrazoon commented Jan 9, 2025

Description

It looks like our SQL Alchemy instance comes with a connection pool, but we didn't actually have it configured and it was running with defaults. And the default pool size is 5, so that was pretty low considering we had 4 workers and 4 child processes per working. I think the fact that max_overflow defaults to 10 is what saved us, because we were just constantly in a state of max overflow with 15 total connections.

We are now increasing concurrency a lot. On production we will have 4 workers with 10 threads each so we need 40 db connections in case they are all using the db at the same time.

Security Considerations

N/A

@terrazoon terrazoon self-assigned this Jan 9, 2025
@terrazoon terrazoon linked an issue Jan 9, 2025 that may be closed by this pull request
Copy link
Contributor

@ccostino ccostino left a comment

Choose a reason for hiding this comment

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

Thanks, @terrazoon!

@terrazoon terrazoon merged commit 67d03dd into main Jan 13, 2025
7 checks passed
@terrazoon terrazoon deleted the connection_pool branch January 13, 2025 16:41
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.

fix db connection pool
4 participants