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

Enable pool_pre_ping to eliminate db connection reset errors #51

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

siddharthvp
Copy link
Collaborator

@siddharthvp siddharthvp commented Jun 14, 2024

This sends a "SELECT 1" to the Trove db every time a db connection is retrieved from the pool. Although it adds slight latency, it is common in db pooling setups and should be worth it as it would eliminate all connection reset errors.

Also set pool_size=12, increasing it from the default 5. We have 10 pods (8 web + 2 worker), so total 120 connections which is very reasonable, as Quarry is the only user of this db.

Bug: T367464

@siddharthvp siddharthvp marked this pull request as ready for review June 14, 2024 07:27
This sends a "SELECT 1" to the Trove db every time a db connection is retrieved from the pool. Although it adds slight latency, it is common in db pooling setups and should be worth it as it would eliminate all connection reset errors.

Also set pool_size=12, increasing it from the default 5. We have 10 pods (8 web + 2 worker), so total 120 connections which is very reasonable, as Quarry is the only user of this db.

Bug: T367464
Copy link
Member

@dhinus dhinus left a comment

Choose a reason for hiding this comment

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

I double-checked and the database currently has max_connections=800, so these values should be fine.

@siddharthvp siddharthvp merged commit dbdf5d7 into main Jun 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants