Estimate how many database connections a service deployment (API via
Apache mod_wsgi + RPC workers, e.g. neutron with ML2/OVS, nova, …)
can open, to size the database's max_connections.
Agents never talk to SQL directly and are not counted.
| process type | pods | procs/pod | peak/proc | peak |
|---|---|---|---|---|
| reachable peak | 0 | |||
The pool is lazy but keeps up to max_pool_size
(5) connections idle per process for reuse;
overflow connections are closed on return. A service under normal load
converges to this — it is what SHOW PROCESSLIST shows on an
ordinary day (a plateau it grows toward, not a guarantee).
The worst case that can actually happen: a connection is only held while
a thread runs a query, so a process never holds more than its thread
count. A 1-thread mod_wsgi process holds at most 1; an RPC worker with
64 executor threads is bound by the pool cap
(55) when threads exceed it.
Size max_connections for this, plus ~20% headroom and
room for the other services sharing the database server.
Pure configuration ceiling: every process is allowed 55 connections, even single-threaded ones that can never use them. Only becomes real if thread counts grow to meet it. Nothing can ever exceed this, but it is too pessimistic for sizing.