max_connections
This page is part of MariaDB's Documentation.
The parent of this page is: System Variables for MariaDB Enterprise Server
Topics on this page:
Overview
Maximum number of clients allowed to connect concurrently.
DETAILS
The max_connections
system variable sets the maximum number of clients allowed to connect concurrently.
Memory Usage
When the value of max_connections
is increased, the server's memory usage can also increase, because each client connection can require additional memory on the server.
The amount of memory used by each connection depends on the values of several system variables, including, but not limited to:
The amount of memory used by each connections also depends on the features in use by the connection, including, but not limited to:
The number of temporary tables being used
The complexity of the queries being executed
The number of tables being joined by the queries
If binary logging is enabled
PARAMETERS
Command-line | --max_connections=# |
Configuration file | Supported |
Dynamic | Yes |
Scope | Global |
Data Type | BIGINT UNSIGNED |
Minimum Value | 10 |
Maximum Value | 100000 |
Product Default Value | 151 |
SKYSQL
EXAMPLES
Show Value with SHOW VARIABLES
SHOW GLOBAL VARIABLES
can show the global value:
SHOW GLOBAL VARIABLES
LIKE 'max_connections';
Since this system variable is only global scope, SHOW VARIABLES
and SHOW SESSION VARIABLES
also show the global value.
Query Value using @@global
and @@session
In SELECT
and other SQL statements, @@global
can be queried for the global value:
SELECT @@global.max_connections;
Since this system variable is only global scope, @@session
can't be queried for this variable.
Information Schema
The information_schema.SYSTEM_VARIABLES
table can be queried to obtain details about the system variable:
SELECT *
FROM information_schema.SYSTEM_VARIABLES
WHERE VARIABLE_NAME LIKE 'max_connections';
The information_schema.GLOBAL_VARIABLES
table can be queried to obtain the global value:
SELECT *
FROM information_schema.GLOBAL_VARIABLES
WHERE VARIABLE_NAME LIKE 'max_connections';
This system variable is only global scope, so the information_schema.SESSION_VARIABLES
table can also be queried to obtain the global value:
SELECT *
FROM information_schema.SESSION_VARIABLES
WHERE VARIABLE_NAME LIKE 'max_connections';