[Tool] Add diagnostics.sql script for troubleshooting (#28428)

Signed-off-by: Alex Zhu <zhuming9011@gmail.com>
This commit is contained in:
Alex Zhu 2023-08-02 14:00:14 +08:00 committed by GitHub
parent ea7fd02948
commit 03787609a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

23
tools/diagnostics.sql Normal file
View File

@ -0,0 +1,23 @@
-- diagnostics.sql
-- This script collects key system information to help diagnose
-- and troubleshoot performance issues.
-- This data can help identify system bottlenecks,
-- debug problems, and guide optimization efforts.
-- example:
-- cat diagnostics.sql | mysql -h127.0.0.1 -P9030 -uroot |gzip > diagnostics.gz
show frontends\G;
show backends\G;
show variables\G;
admin show frontend config\G;
select * from information_schema.loads\G;
select * from information_schema.routine_load_jobs\G;
select * from information_schema.be_metrics\G;
select * from information_schema.be_bvars\G;
select * from information_schema.be_cloud_native_compactions\G;
select BE_ID, NAME, VALUE from information_schema.be_configs\G;
show proc '/compactions'\G;
select BE_ID, LOG from (select BE_ID, TIMESTAMP, LOG from information_schema.be_logs where LEVEL='W' or LEVEL='E' order by TIMESTAMP DESC limit 5000) t order by BE_ID, TIMESTAMP ASC;