Skip to content
Tickwise
ErrorDatabasesSIG-DB-004

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

  1. Work out the total pool size: for each server in the network, add up the maximum-pool-size of plugins using MySQL/MariaDB (LuckPerms defaults to 10) and multiply by the number of servers.
  2. Compare it with SHOW VARIABLES LIKE 'max_connections'; (and max_user_connections) on the database; current connections — SHOW STATUS LIKE 'Threads_connected';.
  3. Reduce maximum-pool-size where the load is light (3–5 is often enough for LuckPerms on a backend), or raise max_connections if the database allows it.
  4. 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.

Sources