Build1 distinct publisher2 min readPublished
Fifty concurrent users need about five MySQL connections in a dev.to worked example, because the quantity to size against is simultaneous queries, and Go opens a connection only when a request asks for one.
The Engineer · Build desk

build
The agent asks, the gateway decides: why read-only is not a security boundary1 distinct publisher
build
SSE in Go breaks twice before your handler runs: an illegal header, then a 30-second timeout1 distinct publisher
build
Your meter now runs on someone else's machine: signed receipts, fsync, and failing open1 distinct publisher
build
Slow Magento reindexes are a price index problem, and raw SQL makes it worse1 distinct publisher
Compiled by The EngineerSomething wrong?How this is made
With five connections busy, the sixth request that needs the database waits for one to be returned to the pool [6]. That wait happens on the borrow, inside your process, because the pool is an application-side collection of reusable connections that requests check out and hand back [9]. So the failure signature of an undersized pool shows up as your own handler latency; the database itself never reports an error. An app that has just started and reports zero open connections is behaving exactly as documented [5].
The walkthrough's own figures give a ratio worth naming. Fifty users online, perhaps five requests actually needing MySQL at a given instant, which is ten users per connection [12]. That is a claim about their workload. For it to transfer, your query durations have to be in the same range, roughly the same share of your requests must never touch the database at all, and your users have to spend as much time reading and typing as theirs do [3]. Change any one of those and the ratio moves. The number that survives the move is the count of queries in flight at peak, which is the thing MaxOpenConns is actually rationing.
The snippet sets two timers, two minutes of idle time and a thirty-minute lifetime, a fifteenfold spread [1][13]. The piece lists the difference between MaxIdleConns and ConnMaxIdleTime among the questions it set out to answer, and the text supplied here breaks off before it gets there [10]. That leaves the interesting gap undefended: MaxOpenConns is five while MaxIdleConns is one [1]. Connection setup is not free, since it can involve network communication, authentication, server-side resource allocation, session initialisation and extra CPU and memory [7]. A pool permitted to grow to five while retaining fewer idle sockets pays some of that setup again on the next burst. Whether it does, and how much, depends on what your driver does with MaxIdleConns, which is the line to read before you copy the four lines.
The multi-tenant trap comes down to arithmetic. The cap is stated per application: five open connections at the same time for that process [16]. Run the service in several instances and the server sees the cap once per instance, so the figure to compare against the database's own connection limit is MaxOpenConns multiplied by replica count [15]. Scaling out horizontally therefore raises database-side connection pressure without anyone editing the pool config. The distinction between users and queries is exactly what the article says matters for SaaS and multi-tenant systems [11], and the corollary is that tenant counts belong nowhere in this calculation.
Ranked by verification strength, evidence, and original report placement.
A dev.to walkthrough headlined "MySQL Connection Pooling Explained: Do 50 Concurrent Users Need 50 Database Connections?" opens with four Go configuration calls: SetMaxOpenConns(5), SetMaxIdleConns(1), SetConnMaxIdleTime(2 * time.Minute) and SetConnMaxLifetime(30 * time.Minute).
The article's short answer to its headline question is that 50 concurrent users do not mean you need 50 MySQL connections.
The article states that concurrent users are not the same as concurrent database queries, since users online may be reading a page, looking at previously loaded data, typing into a form, waiting before clicking, or calling an API that does not require the database.
In the article's example of 50 users online, at a specific moment perhaps only 5 requests actually need MySQL, illustrated by a pool of five connections C1 to C5 all running queries.
The article notes that MaxOpenConns = 5 does not mean Go immediately creates 5 connections at startup; connections are generally created as needed, and with no database activity 0 connections may exist.
The article states that once all 5 connections are busy, new requests that need a database connection may have to wait.
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 29, 2026
Follow any of these and your For You feed starts watching them — no settings page required.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
One explainer, no measurement
The mechanics dev.to describes — lazy creation, borrow and return, waiting once the ceiling is reached — match how Go's pool actually behaves, and the writing is internally consistent. What is missing is anything from outside the author's own telling: no documentation cited, no benchmark, no trace from a running service, and the two query times that drive the whole argument are chosen for the sake of the example. The text also stops mid-sentence, leaving one of the five questions it opened with unanswered.
No usage reported
Nobody's production pool appears in this reporting. dev.to's walkthrough is instructional from start to finish — no service named, no fleet size, no before-and-after latency — so there is nothing to say about how widely pools are actually configured this way.
Deflationary argument, hypothetical arithmetic
The headline poses a sizing question and the answer is admirably unglamorous: stop counting users. The slight overshoot is that ten users per connection reads like a rule when it is entirely a consequence of the 50ms query the author picked — the same page then shows the ratio collapsing when queries take two seconds. Treat the number as a teaching device and the gap closes.
Author-published, nothing being sold
No vendor stands behind this. It is a self-published developer post with no product, no pricing and no tool to adopt; the return is readership, which is visible in the question-shaped headline and the nod toward SaaS and multi-tenant readers. That is mild pressure toward a tidy answer, not pressure toward anyone's answer in particular.
Uncontested but unverified
We are confident about what was said and only moderately confident it transfers. One publisher, nothing here contradicting anything else in it, and a subject that has been stable for years — but a single teaching example cannot tell you the right pool size for your own service, and the unfinished section means part of the promise was never kept.