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

Feature: Multi-threading in PgBouncer #1021

Open
JelteF opened this issue Feb 8, 2024 · 4 comments
Open

Feature: Multi-threading in PgBouncer #1021

JelteF opened this issue Feb 8, 2024 · 4 comments

Comments

@JelteF
Copy link
Member

JelteF commented Feb 8, 2024

We currently have support for multi-process PgBouncer using so_reuseport, but actual multi-threading is preferable since it is not super easy to set up so_reuseport together with peering. Also, pool limits are not shared when using multi-process, as well as stats queries only showing stats of one process.

Things that at least would need to happen:

  1. Make the lists that contain clients/servers thread safe to access
  2. Stats would need to be gathered in a thread safe way
@vitabaks
Copy link

+1

1 similar comment
@Catwoolfii
Copy link

+1

@jonahharris
Copy link

Mason and I are in the process of porting the multithreaded PgBouncer I wrote for NEXTGRES to the latest version. Will push an Alpha next week, which will require a bit of clean-up and decisions as to how multithreading is handled and whether it gets ifdef'd or mainlined. Preliminary code will be in this branch

@JelteF
Copy link
Member Author

JelteF commented Feb 28, 2024

That sounds amazing! Please open a PR once you have that Alpha ready then I can take a look at it.

I think we wouldn't want it ifdef-ed, since then it will be hard to test for people using pre-built binaries. But we'd probably want it opt-in with a config flag for a few versions after merging. To allow the community to help find some bugs/perf issues, while having an easy way to roll back to the single threaded mode.

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

4 participants