Database connection limit exceeded (Too many connections)
- Platforms
- Paper · Purpur · Velocity · whole network
- Verified
- Verified
- Confidence
- Confidence 85%
What it looks like in the log
Any one of these lines is enough. The agent matches them locally, on your server.
logs/latest.log
[WARN] Too many connections
Symptoms
- New connections to MySQL/MariaDB are rejected: “Too many connections” (error 1040)
- Plugins on some servers in the network cannot connect to the shared database
Cause
The database server has run out of max_connections: the combined plugin connection pools on all servers in the network (or unrelated clients) hold more connections than allowed.
Possible causes
- The sum of maximum-pool-size across all plugins × the number of servers in the network exceeds the database's max_connections (shared database hosting often caps it at 10–50)
- A connection leak in a plugin or “stuck” connections left after server crashes
- The max_user_connections limit for the database user is lower than the pools need
How to fixLow risk
- Work out the total pool size: for each server in the network, add up the
maximum-pool-sizeof plugins using MySQL/MariaDB (LuckPerms defaults to 10) and multiply by the number of servers. - Compare it with
SHOW VARIABLES LIKE 'max_connections';(andmax_user_connections) on the database; current connections —SHOW STATUS LIKE 'Threads_connected';. - Reduce
maximum-pool-sizewhere the load is light (3–5 is often enough for LuckPerms on a backend), or raisemax_connectionsif the database allows it. - If there are more connections than the configs account for, look for a leak (enable
leak-detection-threshold, see SIG-DB-012).
Translated from the Russian original; log lines are quoted verbatim.