Last active
August 29, 2015 13:56
-
-
Save netmarkjp/8986819 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select T_NOW.CONN / T_MAX.CONN * 100 as CONN_USAGE | |
from | |
( select 1 as k, VARIABLE_VALUE as CONN from information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Threads_connected' ) as T_NOW | |
join | |
(select 1 as k, VARIABLE_VALUE as CONN from information_schema.GLOBAL_VARIABLES where VARIABLE_NAME = 'max_connections' ) as T_MAX | |
on T_NOW.k = T_MAX.k |
recommend: use with check_mysql_query
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
replication connections are not counted.