mysql view connections, up to the number of concurrent

 

show status like '% max_connections%'; ## mysql maximum number of connections

set global max_connections = 1000 ## Reset

show variables like '% max_connections%'; ## queries the database maximum number of connections currently set

show global status like 'Max_used_connections'; the maximum number of connections the server response ##

show status like 'Threads%';

Variable_name Value

Thread pool Threads_cached 0 ## mysql management how many resources can be multiplexed

Threads_connected open connections 152 ##

Threads_created 550 ## indicates the number of threads created before, if you find Threads_created value is too large, it indicates that the MySQL server has been created in the thread, which is more consumption of resources can be appropriately increased profile thread_cache_size value, query server

Threads_running 1 ## active connections, this value is generally much lower than the values ​​connected, is accurate, it is representative of the current number of concurrent Threads_running

show variables like 'thread_cache_size';

set global thread_cache_size=60;

Guess you like

Origin www.cnblogs.com/iniu/p/12014395.html