Get the App
SLTechnology News&Howtos  ›  Database  › 

Too many connections error

Shulou Source: shulou.com Published: 2022-06-01 08:04:28 10月03日 Update

Today we reported that our website was down, the log error was too many connections error, below to investigate the root cause.

My initial suspicion is that max_connections is too small.

Why hasn't this error occurred before? Could it be an increase in business? Or is it Internet ***?

Basic knowledge:

To solve the problem of too many connections, you can start with two parameters:

max_connections and wait_timeout and interactive_timeout

interactive_timeout: The number of seconds the server waits for activity before closing the interactive connection.

wait_timeout: Number of seconds the server waits for activity before closing a non-interactive connection.

These two parameters must be used together. Otherwise, setting wait_timeout alone is invalid

View the maximum number of connections set and the number of connections already used:

show variables like "%max_connection%";

show status like "%used%";

Set the maximum number of connections:

set GLOBAL max_connections=256;(temporary)

max_connections=N in profile modification (permanent)

Tags: Error maximum parameter server service activity business two interactive cause basic basic knowledge file log fundamental knowledge network permanent response investigation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MariaDB Shulou Tech Info Shulou Information Apple