Sunday, July 29, 2018

Performance check for MySQL

show status where `variable_name` = 'Threads_connected';

show processlist
==================================

-- SET GLOBAL interactive_timeout = 1000; -- 28800 -- carefull

-- SET GLOBAL wait_timeout = 1000; -- 28800 -- carefull

SHOW STATUS WHERE `variable_name` = 'Threads_connected';

SHOW VARIABLES LIKE "max_connections"

====================================

SHOW SESSION STATUS;

show full processlist

show status where `variable_name` = 'Threads_connected';

-- kill 32042; -- carefull
-- pt-kill  -- carefull
SHOW GLOBAL STATUS;

SHOW VARIABLES LIKE "%wait%"

select concat('KILL ',id,';') from information_schema.processlist where Command='Sleep';

-- set global max_connections = 567; -- carefull

Below is to enable the Logs and set it off back
====================================

-- SET GLOBAL general_log = 'ON';

-- SHOW VARIABLES LIKE "general_log%";

-- SET GLOBAL general_log = 'OFF';

No comments:

Post a Comment

Postgress - Read a XML file from a postgress table XML column

SELECT xmltable.* FROM xmldata, XMLTABLE('//ROWS/ROW' PASSING data COLUMNS id int PATH ...