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 PgBouncer for Production #605

Closed
3 tasks
Tracked by #213
darunrs opened this issue Mar 18, 2024 · 2 comments
Closed
3 tasks
Tracked by #213

Enable PgBouncer for Production #605

darunrs opened this issue Mar 18, 2024 · 2 comments
Assignees

Comments

@darunrs
Copy link
Collaborator

darunrs commented Mar 18, 2024

  • Create a Confluence guide to troubleshoot and manage pgBouncer parameters: connection timeout, default pool size, max connection size and how to specify this per user
  • Remove the local pooler from the runner
  • Deploy to production
@darunrs
Copy link
Collaborator Author

darunrs commented Mar 26, 2024

What has been done:

  • Deploy code preparing Runner for using pgBouncer.
  • Create Infra PR to start up pgBouncer on Runner startup.
  • Create pgbouncer role as admin role with password pgbouncer
  • Create security definer function as pgbouncer role
    • I got access errors when I created function as admin role. Maybe if I also added admin with access to pg_shadow, this would work too? Haven't tested this yet.
  • Add cloudsql.pg_shadow_select_role to postgres instance for pgbouncer role
  • Add postgres url to pgbouncer startup script

What needs to be done:

  • Configuring pgBouncer to work properly
  • Replace pgBouncer role password with a proper password
  • Configure startup script to somehow read the secret value
  • Replicating manual steps in prod

@pkudinov pkudinov assigned eduohe and unassigned darunrs Mar 26, 2024
@eduohe
Copy link

eduohe commented Mar 29, 2024

I did some benchmarks and here is the doc with details pgBouncer on QueryAPI.

TLDR; pgBouncer not only solves the max connection issue, but we can see improvements in performance (TPS - transactions per second)

@pkudinov pkudinov assigned darunrs and unassigned eduohe Apr 2, 2024
@pkudinov pkudinov changed the title Introduce PgBouncer to Postgres Enable PgBouncer for Production Apr 9, 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

No branches or pull requests

3 participants