Why Connection Pooling Matters for MySQL Performance

Opening a new MySQL connection is surprisingly expensive — TCP handshake, authentication, session setup — which adds up fast under real traffic. Connection pooling reuses existing connections instead of creating one per request.

// PHP-FPM's process model means PDO connections aren't naturally pooled
// across requests unless you use persistent connections carefully:
$pdo = new PDO($dsn, $user, $pass, [
    PDO::ATTR_PERSISTENT => true, // reuses a connection across requests on the same worker
]);

Real Pooling: ProxySQL or a Language-Level Pool

For genuinely high-concurrency applications, a dedicated connection pooler like ProxySQL sits between your application and MySQL, maintaining a fixed pool of real database connections and multiplexing many more application-side connections onto them — this is where connection pooling actually pays off at scale.

Without pooling, a traffic spike that opens thousands of short-lived connections can exhaust MySQL’s max_connections limit long before the database itself is actually under CPU or memory pressure — pooling addresses exactly that failure mode.