Skip to content

Add user specific reserve pool size#1228

Merged
JelteF merged 7 commits intopgbouncer:masterfrom
greg-rychlewski:user_reserve_pool
Dec 24, 2024
Merged

Add user specific reserve pool size#1228
JelteF merged 7 commits intopgbouncer:masterfrom
greg-rychlewski:user_reserve_pool

Conversation

@greg-rychlewski
Copy link
Copy Markdown
Contributor

Closes #166

Copy link
Copy Markdown
Member

@JelteF JelteF left a comment

Choose a reason for hiding this comment

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

Change looks good. But lets change the option its name to reserve_pool_size. I realize that the database section uses reserve_pool, but that name seems just wrong. Would be good to change that in a backwards compatible way in another PR.

Comment thread doc/config.md Outdated
Set the maximum size of pools for all connections from this user. If not set,
the database or `default_pool_size` is used.

### reserve_pool
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's stay consistent with the naming of this option and call this reserve_pool_size throughout the PR.

Suggested change
### reserve_pool
### reserve_pool_size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done!

@greg-rychlewski
Copy link
Copy Markdown
Contributor Author

Thanks for the review. That's a good point about the naming. I'll submit a PR after this one for the database configuration.

JelteF pushed a commit that referenced this pull request Dec 24, 2024
Based on discussion here:
#1228

Updating the database parameter name from `reserve_pool` to
`reserve_pool_size` to be consistent with everything else.
@JelteF
Copy link
Copy Markdown
Member

JelteF commented Dec 24, 2024

Needs a merge conflict resolution, other than that this looks good to merge

@JelteF JelteF enabled auto-merge (squash) December 24, 2024 00:39
auto-merge was automatically disabled December 24, 2024 00:39

Head branch was pushed to by a user without write access

@greg-rychlewski
Copy link
Copy Markdown
Contributor Author

Sorry @JelteF I had to push again because I messed up the conflict resolution and it cancelled your automerge.

Comment thread test/test_limits.py
# respoolsize1 user has a pool_size of 1 and reserve_pool_size of 2
# this means 1 connection should happen immediately while 2 out of
# the 3 remaining connections happen after reserve_pool_timeout
result = bouncer.asleep(10, dbname="p0a", user="respoolsize1", times=4)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this one using p0a and the other ones p0?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

p0 has the bouncer user configured to it while p0a does not have any user. From my testing it seems like no matter who I am connecting as to p0, it will apply the pool settings of the configured user.

@JelteF JelteF mentioned this pull request Dec 24, 2024
2 tasks
@JelteF JelteF merged commit 83eb532 into pgbouncer:master Dec 24, 2024
@greg-rychlewski greg-rychlewski deleted the user_reserve_pool branch December 24, 2024 19:05
rajaryanece pushed a commit to rajaryanece/pgbouncer that referenced this pull request Jan 16, 2025
Based on discussion here:
pgbouncer#1228

Updating the database parameter name from `reserve_pool` to
`reserve_pool_size` to be consistent with everything else.
rajaryanece pushed a commit to rajaryanece/pgbouncer that referenced this pull request Jan 16, 2025
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.

Feature request: Per-user configuration of pool size

2 participants