ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / infra/pgbouncer/README.md

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / infra/pgbouncer/README.md
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberinfra/pgbouncer/README.md
Original SHA-25636e0a2e5c70e3d6ee104b9e867b68ce72cab13801aa3787a666ff18b0ca96160
Git blob SHA9831e4b87d2b210ab3e1c3a20859f3bac25dac26
Reading-copy SHA-25636e0a2e5c70e3d6ee104b9e867b68ce72cab13801aa3787a666ff18b0ca96160

Original source ↗

Every recorded occurrence

These 2 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / infra/pgbouncer/README.mdfeature/opportunity-to-outcome720d47fae476b0d38477ae4401697d372b1ea2bcOpen original
Janady13/missionmatch / infra/pgbouncer/README.mdfeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original

Recovered source transcript

# PgBouncer for the per tenant databases Transaction pooling in front of the control plane and every tenant database. The API keeps its pgxpool per database; PgBouncer multiplexes those onto a small, bounded set of real Postgres backends so per tenant pools scale to many tenants without exhausting max_connections. ## Why transaction mode is safe here Every tenant scoped read and write in this codebase runs inside one transaction through RunInTenantTx, which sets the org GUC with set_config('app.current_org_id', $1, true), the transaction scoped form. Nothing tenant scoped relies on session state across transactions, so transaction pooling cannot leak one org's GUC into another's connection. Do not route anything session scoped (LISTEN or NOTIFY, SET without LOCAL, session advisory locks) through this pool. ## Staging enablement (macOS host, Homebrew) 1. brew install pgbouncer 2. Copy pgbouncer.ini to /opt/homebrew/etc/pgbouncer/pgbouncer.ini and adjust the [databases] section to the databases present on the host. 3. Generate the real userlist.txt on the host per userlist.txt.example, chmod 600. 4. Start: pgbouncer -d /opt/homebrew/etc/pgbouncer/pgbouncer.ini 5. Point the staging DSNs at port 6432 (only the port changes): postgres://missionmatch_app:...@127.0.0.1:6432/missionmatch_staging 6. Verify: psql "postgres://missionmatch_app:...@127.0.0.1:6432/missionmatch_staging" -c "select 1" and SHOW POOLS on the pgbouncer admin console. ## Production notes The same ini shape ships to the cloud hosts (systemd unit instead of a manual start). Per tenant provisioning adds one [databases] line per new tenant database; the onboarding runbook owns that step. Pool sizing starts at default_pool_size 12 per database and is tuned from SHOW POOLS saturation, never guessed.

Search equations, builds, manuscript text, and recovered sources.