-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
监控项增加、调整建议 #23
Comments
解决方案:
|
re-f
added a commit
that referenced
this issue
Jul 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
增加监控状态、配置信息: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';
展示数据建议使用用户与时间关联
The text was updated successfully, but these errors were encountered: