Mysql view the number of connections, the maximum number of concurrent status

show status like '%max_connections%'; ##mysql maximum number of connections
set global max_connections=1000 ##Reset
show variables like '%max_connections%'; ##Query the maximum number of connections currently set by the database

show global status like 'Max_used_connections'; ##The maximum number of connections the server responds to

show status like 'Threads%';

Variable_name Value
Threads_cached 0 ##How many resources can be reused in the thread pool managed by mysql
Threads_connected 152 ##Number of open connections
Threads_created 550 ##Indicates the number of threads created. If the value of Threads_created is found to be too large, it indicates that the MySQL server has been creating threads, which is also more resource-intensive. You can appropriately increase the thread_cache_size value in the configuration file to query the server
Threads_running 1 ##The number of active connections. This value is generally much lower than the connected value. To be precise, Threads_running represents the current number of concurrent connections.

show variables like 'thread_cache_size';
set global thread_cache_size=60;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325016511&siteId=291194637