Restore pgbouncer admin user instruction

33cb69ad07 omitted the instruction for how to set pgbouncer admin user.
This commit is contained in:
Sai 2023-03-26 16:22:30 +01:00 committed by GitHub
parent ad28620313
commit 8fd5b4c7ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -169,6 +169,10 @@ Put `md5` as the `auth_type` (assuming youre using the md5 format in `userlis
Make sure the `pgbouncer` user is an admin:
```ini
admin_users = pgbouncer
```
**This next part is very important!** The default pooling mode is session-based, but for Mastodon we want transaction-based. In other words, a Postgres connection is created when a transaction is created and dropped when the transaction is done. So youll want to change the `pool_mode` from `session` to `transaction`:
Next up, `max_client_conn` defines how many connections PgBouncer itself will accept, and `default_pool_size` puts a limit on how many Postgres connections will be opened under the hood. (In PgHero the number of connections reported will correspond to `default_pool_size` because it has no knowledge of PgBouncer.)