Skip to main content
READY SIDEKIQHEAP TRIAGE // AMBER TRIAGE HUD TARGET: PUMA + SIDEKIQ JEMALLOC | REDIS NOEVICTION | INTERCOM EXIT
ChatwootQueues
ChatwootQueues Partner Notice: Outbound /go/ links marked rel="sponsored" may earn a referral fee at zero checkout surcharge (Disclosures).
Remediation Hub (9)

Add PgBouncer Transaction Pooling for Multi-Pod Chatwoot

PgBouncer multiplexes dozens of idle Puma and Sidekiq database threads onto 15-25 real PostgreSQL backends, slashing backend RAM overhead.

Pool Mode: transaction | PG Backends: 20 vs 80+ direct connections

Add PgBouncer Transaction Pooling for Multi-Pod Chatwoot
Telemetry verified 2026-10-31 by SidekiqHeap Triage.

Why Direct Puma + Sidekiq Connections Exhaust Postgres RAM

Each PostgreSQL backend process consumes 8-15 MB of private memory plus work_mem during sorts. Scaling Puma to 4 workers (20 threads) plus two Sidekiq pods (25 threads) demands 45+ open connections even when most threads sit idle waiting on HTTP webhooks.

Transaction Pooling Settings Compatible with Rails

Run PgBouncer with pool_mode = transaction, max_client_conn = 200, and default_pool_size = 20. In Chatwoot Rails database configuration, disable prepared statements (prepared_statements: false) when routing through transaction-mode PgBouncer.

Measured Thresholds & Configuration

PgBouncer SettingRecommended ValueOperational Benefit
pool_modetransactionReuses PG backends across idle Rails threads
default_pool_size20 (per DB)Caps active PG processes inside RAM budget
prepared_statementsfalse in Rails DB configPrevents PG statement mismatch errors
Pool Mode: transaction | PG Backends: 20 vs 80+ direct connections Deploy Hostinger KVM 4Vultr Cloud 8 GB ($40/mo)