Skip to content

Instantly share code, notes, and snippets.

@Slauta
Created February 23, 2018 15:06
Show Gist options
  • Save Slauta/4e3ec6ae818f5da7eb61d6f2d98625bb to your computer and use it in GitHub Desktop.
Save Slauta/4e3ec6ae818f5da7eb61d6f2d98625bb to your computer and use it in GitHub Desktop.
Enable slow query
SET GLOBAL log_output=file;
SET GLOBAL slow_query_log=ON;
SET GLOBAL long_query_time=0;
SET GLOBAL log_slow_rate_limit=100;
SET GLOBAL log_slow_rate_type=query;
SET GLOBAL log_slow_verbosity=full;
SET GLOBAL log_slow_admin_statements = ON;
SET GLOBAL log_slow_slave_statements = ON;
SET GLOBAL slow_query_log_always_write_time=1;
SET GLOBAL slow_query_log_use_global_control=all;
SET GLOBAL innodb_monitor_enable=all;
SET GLOBAL userstat=1;
INSTALL PLUGIN QUERY_RESPONSE_TIME_AUDIT SONAME 'query_response_time.so';
INSTALL PLUGIN QUERY_RESPONSE_TIME SONAME 'query_response_time.so';
INSTALL PLUGIN QUERY_RESPONSE_TIME_READ SONAME 'query_response_time.so';
INSTALL PLUGIN QUERY_RESPONSE_TIME_WRITE SONAME 'query_response_time.so';
SET GLOBAL query_response_time_stats=ON;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment