From 4776a41c01f8671809d2e62d5dd8eadc27a2bb43 Mon Sep 17 00:00:00 2001 From: openhands Date: Sun, 18 Oct 2026 14:50:33 +0200 Subject: [PATCH] fix(env): align suggested DB pool size with MariaDB max_connections The example .env suggested DATABASE_POOL_SIZE=150 and connection_limit=150. MariaDB defaults max_connections to 151, so a single CMS instance could claim the server's entire connection budget, starving the emulator and any second instance. The README already documents a pool size of 25; the example now matches and notes that DATABASE_POOL_SIZE is the value that actually applies. --- .env.example | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index bd7c8ae4..37f5f68d 100644 --- a/.env.example +++ b/.env.example @@ -3,8 +3,13 @@ # ============================================================================== # --- DATABASE (High Performance Pooling & Strict Timeouts) --- -DATABASE_URL="mysql://user:password@localhost:3306/dbname?charset=utf8mb4&connection_limit=150&connect_timeout=5" -DATABASE_POOL_SIZE=150 +# The pool size is governed by DATABASE_POOL_SIZE (src/lib/db.ts); the +# `connection_limit` in the URL is only honoured by tools that read the URL +# directly (drizzle-kit, scripts). Keep both in step and keep them well below +# MariaDB's `max_connections` (151 by default) or the emulator and any second +# CMS instance get "Too many connections". README §performance: pool size 25. +DATABASE_URL="mysql://user:password@localhost:3306/dbname?charset=utf8mb4&connection_limit=25&connect_timeout=5" +DATABASE_POOL_SIZE=25 DATABASE_IDLE_TIMEOUT_MS=60000 DATABASE_CONNECT_TIMEOUT_MS=5000