Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_int-connection-pooler

Database Connection Pooler Internals (PgBouncer Transaction Multiplexing)

8 COMPONENTS · 7 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Database Connection Pooler Internals (PgBouncer Transaction Multiplexing) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_int-connection-pooler/opengraph-image)](https://archos.sageideas.dev/d/dgm_int-connection-pooler)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_int-connection-pooler)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_int-connection-pooler" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Database Connection Pooler Internals (PgBouncer Transaction Multiplexing) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Stateless API Pods"]
  ev_1["libevent Epoll Loop"]
  auth_2["SCRAM Auth & TLS"]
  queue_3[("Client Wait Queue")]
  pool_4[("Server Conn Pool")]
  db_5[("PostgreSQL Primary")]
  met_6["SHOW POOLS Telemetry"]
  downstream_7["Downstream & OTel"]
  client_0 -->|"1. 500 app · TLS/SQL"| ev_1
  ev_1 -->|"2. Verify · Auth"| auth_2
  auth_2 -->|"3. Enqueue · FIFO"| queue_3
  pool_4 -->|"Assign · TX Mode"| queue_3
  pool_4 -->|"20 active · SQL"| db_5
  met_6 -->|"Export · Metrics"| queue_3
  queue_3 -.->|"4. Emit / · OTLP/API"| downstream_7

COMPONENT STACK (8)

  • Stateless API PodsSTATELESS
    500 concurrent conns
  • libevent Epoll LoopSTATELESS
    Non-blocking TCP accept
  • SCRAM Auth & TLSSTATELESS
    Terminates client TLS
  • Client Wait QueueSTATEFUL
    Bounded wait_timeout queue
  • Server Conn PoolSTATEFUL
    20 warm Postgres backends
  • PostgreSQL PrimarySTATEFUL
    Protected from conn storm
  • SHOW POOLS TelemetrySTATELESS
    cl_waiting & maxwait_us
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (7)

  1. Stateless API Pods → libevent Epoll Loop (500 app)[TLS/SQL]
  2. libevent Epoll Loop → SCRAM Auth & TLS (Verify)[Auth]
  3. SCRAM Auth & TLS → Client Wait Queue (Enqueue)[FIFO]
  4. Server Conn Pool → Client Wait Queue (Assign)[TX Mode]
  5. Server Conn Pool → PostgreSQL Primary (20 active)[SQL]
  6. SHOW POOLS Telemetry → Client Wait Queue (Export)[Metrics]
  7. Client Wait Queue → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →