Skip to main content


Huh, the Mastodon docs still say to set `PREPARED_STATEMENTS=false` if you're using pgbouncer because “[s]ince we’re using transaction-based pooling, we can’t use prepared statements”, but pgbouncer 1.22+ can handle it: https://www.pgbouncer.org/config.html#max_prepared_statements

I'm going to YOLO it and turn that on for #FRZ. That could make a big dent in my DB resources.

#FRZ
in reply to Tek is not a convicted felon

I've restarted pgbouncer with `PGBOUNCER_MAX_PREPARED_STATEMENTS=1000`. I'm gonna let that bake for a bit before doing anything else.
in reply to Tek is not a convicted felon

I got bored and set `PREPARED_STATEMENTS=true` on all the Sidekiq workers here on #FRZ. Now they're all using prepared statements on pgbouncer 1.23 which supports it for statement pooling mode. Nothing's exploded yet. It's too soon to see a resource difference, but pgbouncer *does* show clients and servers with hundreds of prepared statements.
#FRZ