You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
增加监控状态、配置信息:read_only、server_id
获取方式
show variables like 'server_id'
show global status like 'read_only'
用户会话非空闲状态的top3持续时间
目前进取show processlist或select * from Information_schema.processlist输出中time字段,并未进行过滤
建议
获取show processlist或select * from Information_schema.processlist输出中time字段,根据以下条件过滤
states not in ('','sleep') and user not in ('root','repl')
并且展示数据建议使用用户与时间关联,而非TOP
未提交事务最长持续时间
建议监控未提交事务的状态,如果存在多值取top3即可。
SELECT p.user,p.time FROM information_schema.innodb_trx t INNER JOIN information_schema.processlist p ON t.trx_mysql_thread_id = p.id WHERE t.trx_state = 'RUNNING' AND p.time > 10 AND p.command = 'Sleep';
展示数据建议使用用户与时间关联
增加监控状态、配置信息:read_only、server_id
获取方式
show variables like 'server_id'
show global status like 'read_only'
用户会话非空闲状态的top3持续时间
目前进取show processlist或select * from Information_schema.processlist输出中time字段,并未进行过滤
建议
获取show processlist或select * from Information_schema.processlist输出中time字段,根据以下条件过滤
states not in ('','sleep') and user not in ('root','repl')
并且展示数据建议使用用户与时间关联,而非TOP
未提交事务最长持续时间
建议监控未提交事务的状态,如果存在多值取top3即可。
SELECT p.user,p.time FROM information_schema.innodb_trx t INNER JOIN information_schema.processlist p ON t.trx_mysql_thread_id = p.id WHERE t.trx_state = 'RUNNING' AND p.time > 10 AND p.command = 'Sleep';
展示数据建议使用用户与时间关联