From 9317ff3baeceee0d9c2b7bcb078e381f357fa851 Mon Sep 17 00:00:00 2001 From: Brook Miles Date: Thu, 5 Oct 2023 18:09:10 +0900 Subject: [PATCH] restore ini settings which appear to have been lost in commit 33cb69a (#1314) --- content/en/admin/scaling.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/content/en/admin/scaling.md b/content/en/admin/scaling.md index 9f0a93e7..15e63854 100644 --- a/content/en/admin/scaling.md +++ b/content/en/admin/scaling.md @@ -192,10 +192,22 @@ listen_port = 6432 Put `md5` as the `auth_type` (assuming you’re using the md5 format in `userlist.txt`): +```ini +auth_type = md5 +``` + 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 you’ll want to change the `pool_mode` from `session` to `transaction`: +```ini +pool_mode = 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.) The defaults are fine to start, and you can always increase them later: