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

feat: Add pgBouncer to QueryApi #615

Merged
merged 10 commits into from
Mar 25, 2024
Merged

feat: Add pgBouncer to QueryApi #615

merged 10 commits into from
Mar 25, 2024

Conversation

darunrs
Copy link
Collaborator

@darunrs darunrs commented Mar 21, 2024

QueryApi has experienced issues with Postgres connections since the introduction of * indexers due to how QueryApi creates these connections through Application level connection pools. Since we can't use one pool for all workers, I've introduced PgBouncer as a Middleware to serve as an additional connection pooler in front of the DB.

@darunrs darunrs force-pushed the pgbouncer-pooling branch from b22f84b to 6bf7b4a Compare March 21, 2024 22:03
@darunrs darunrs marked this pull request as ready for review March 21, 2024 22:05
@darunrs darunrs requested a review from a team as a code owner March 21, 2024 22:05
@@ -0,0 +1,12 @@
CREATE ROLE pgbouncer LOGIN;
ALTER ROLE pgbouncer WITH PASSWORD 'pgbouncer';
Copy link
Collaborator Author

@darunrs darunrs Mar 25, 2024

Choose a reason for hiding this comment

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

Password should match DB_PASSWORD in docker container.
Note that this SQL needs to also be run in the postgres instance. It's re-defined in this NEAR Ops PR: https://github.com/near/near-ops/pull/1652

@darunrs darunrs merged commit daf289d into main Mar 25, 2024
5 checks passed
@darunrs darunrs deleted the pgbouncer-pooling branch March 25, 2024 21:32
@darunrs darunrs mentioned this pull request Mar 28, 2024
darunrs added a commit that referenced this pull request Apr 3, 2024
- feat: Instrument Runner Service (#602)
- Support WHERE col IN (...) in context.db.table.select and delete
(#606)
- feat: Include indexer name in context db build failure warning (#611)
- Cache provisioning status (#607)
- Fix ESLint on DmlHandler (#612)
- fix: Substitution 'node-sql-parser' with a forked version until Apri
1st (#597)
- feat: Add pgBouncer to QueryApi (#615)
- feat: Expose near-lake-primitives to VM (#613)

---------

Co-authored-by: Pavel Kudinov <[email protected]>
Co-authored-by: Pavel Kudinov <[email protected]>
Co-authored-by: Kevin Zhang <[email protected]>
Co-authored-by: Morgan McCauley <[email protected]>
This was referenced Apr 22, 2024
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.

1 participant