TGViewer
Computer Science and Programming Computer Science and Programming @computer_science_and_programming · 140K subscribers
Post #2310 13.8K
Connection Pool Sizing, Measured: Why 48 Connections Beat 400
A benchmark sweep of a PostgreSQL instance from 1 to 400 connections shows throughput peaking at 48 connections (18,039 tps) and dropping 37% by 400 connections, while average latency multiplied 13x. The piece explains why connections are OS processes competing for cores rather than free capacity, tests the Universal Scalability Law fit (R²=0.94, predicted optimum 45.1), evaluates the (cores×2)+spindles formula (predicts 9, far off the measured 48), and finds that synchronous_commit=off raises throughput but does not shift the peak. It closes with practical guidance: watch queue depth (cl_waiting in PgBouncer, pending-threads in HikariCP) rather than connection count, account for instances × pool size multiplication, and use transaction pooling or RDS Proxy for Lambda to avoid connection exhaustion.
  • ❤ 11
  • 😁 3
  • 👍 1
More from @computer_science_and_programming
  1. Oct 3, 2026BYD says it will have a solid-state car next year, the earliest date anyone has given BYD…
  2. Oct 1, 2026Introducing G#: A Go-like language for .NET G# is a new open-source, Go-inspired programmi…
  3. Sep 30, 2026Chrome for Developers Chrome 146 introduces three notable features for web developers. Scr…
  4. Sep 26, 2026Introduction to Solon A comprehensive tutorial walks through building a REST API with Solo…
  5. Sep 25, 2026The strangler fig pattern: modernizing without a big-bang rewrite A detailed guide to the…
  6. Sep 24, 2026Lessons From Four Years of Writing a Weekly Newsletter A .NET blogger reflects on four yea…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →