首页 > 数据库 > > 服务端工具-gs_checkperf
GaussDB 200提供了gs_checkperf工具来帮助对集群级别(主机CPU占用率、Gauss CPU占用率、I/O使用情况等)、节点级别(CPU使用情况、内存使用情况、I/O使用情况)、会话/进程级别(CPU使用情况、内存使用情况、I/O使用情况)、SSD性能(写入、读取性能)进行定期检查,让用户了解集群的负载情况,采取对应的改进措施。
LOG: Statistics in some tables or columns(pmk.pmk_snapshot.snapshot_id) are not collected.
HINT: Do analyze for them in order to generate optimized plan.
此时需要登录任一CN实例节点,连接postgres数据库执行如下SQL:
analyze pmk.pmk_configuration;
analyze pmk.pmk_meta_data;
analyze pmk.pmk_snapshot;
analyze pmk.pmk_snapshot_coordinator_stat;
analyze pmk.pmk_snapshot_datanode_stat;
gs_checkperf -U USER [-o OUTPUT] -i SSD [-l LOGFILE]检查集群性能(集群安装用户)
gs_checkperf [-U USER] [-o OUTPUT] [-i PMK] [--detail] [-l LOGFILE]显示帮助信息
gs_checkperf -? | --help显示版本号信息
gs_checkperf -V | --version参数说明
运行集群的用户名称。
取值范围:运行集群的用户名称。
以root用户身份执行此命令必须指定该参数。
指定性能检查报告输出到指定的文件。
取值范围:指定的文件名称。
不指定则将检查结果输出到屏幕上。
指定检查项编号,-i参数值不区分大小写。格式:-i PMK、-i SSD。
取值范围:PMK、SSD
只有集群用户才能检查PMK选项。
只有root用户才能检查SSD选项。
如果不指定该参数,以集群用户身份默认检查PMK,以root用户身份默认检查SSD。
显示PMK检查结果详情。
指定日志文件的存储路径。
默认路径为:mpp/omm/om/gs_checkperf-YYYY-MM-DD_hhmmss.log
显示帮助信息。
显示版本号信息。
分类 | 性能参数项 | 描述 |
|---|---|---|
集群级别 | 主机CPU占用率 | 主机CPU占用率。 |
Gauss CPU占用率 | Gauss CPU占用率。 | |
共享内存击中率 | 共享内存的击中率。 | |
内存中排序比率 | 内存中完成的排序所占比率。 | |
I/O使用情况 | 文件读写次数和时间。 | |
磁盘使用情况 | 文件写次数和平均写时间、最大写时间等。 | |
事务统计 | 当前SQL执行数和Session数。 | |
节点级别 | CPU使用情况 | 主机使用CPU情况,包括cpu busy time,cpu idle time等。 |
内存使用情况 | 主机使用内存情况,包括物理内存总量,已使用量等。 | |
I/O使用情况 | 文件读写次数和时间。 | |
会话/进程级别 | CPU使用情况 | 会话使用CPU情况,包括cpu busy time,cpu idle time等。 |
内存使用情况 | 会话使用内存情况,包括物理内存总量,已使用量等。 | |
I/O使用情况 | 会话共享缓冲区命中次数等。 | |
SSD性能(只用root用户才能查看) | 写入性能 | 使用dd命令(flag=direct bs=8M count=2560)向每个SSD写入内容,写入每个SSD时间应在10s左右。 |
读取性能 | 使用dd命令(flag=direct bs=8M count=2560)从每个SSD读取内容,读取每个SSD时间应在7s左右。 |
示例一:以简要格式在屏幕上显示性能统计结果。
gs_checkperf -i pmk -U omm
Cluster statistics information:
Host CPU busy time ratio : 1.43 %
MPPDB CPU time % in busy time : 1.88 %
Shared Buffer Hit ratio : 99.96 %
In-memory sort ratio : 100.00 %
Physical Reads : 4
Physical Writes : 25
DB size : 70 MB
Total Physical writes : 25
Active SQL count : 2
Session count : 3
示例二:以详细格式在屏幕上显示性能统计结果。
gs_checkperf -i pmk -U omm --detail
Cluster statistics information:
Host CPU usage rate:
Host total CPU time : 42386.667 Jiffies
Host CPU busy time : 1873.333 Jiffies
Host CPU iowait time : 20.000 Jiffies
Host CPU busy time ratio : 4.42 %
Host CPU iowait time ratio : .05 %
MPPDB CPU usage rate:
MPPDB CPU time % in busy time : 19.04 %
MPPDB CPU time % in total time : .84 %
Shared buffer hit rate:
Shared Buffer Reads :
Shared Buffer Hits : 24129
Shared Buffer Hit ratio : 100.00 % In-memory sort ratio : 100.00 %I/O usage:
Number of files : 537
Physical Reads :
Physical Writes :
Read Time : ms
Write Time : ms
Disk usage:
DB size : 70 MB
Total Physical writes :
Average Physical write :
Maximum Physical write :
Activity statistics:
Active SQL count : 2
Session count : 3
Node statistics information:
cn_5001:
MPPDB CPU Time : 480 Jiffies
Host CPU Busy Time : 3480 Jiffies
Host CPU Total Time : 42370 Jiffies
MPPDB CPU Time % in Busy Time : 13.79 %
MPPDB CPU Time % in Total Time : 1.13 %
Physical memory : 8231776256 Bytes
DB Memory usage : 742989824 Bytes
Shared buffer size : 33554432 Bytes
Shared buffer hit ratio : 100.00 %
Sorts in memory : 1
Sorts in disk : In-memory sort ratio : 100.00 %
Number of files : 108 Physical Reads :
Physical Writes :
Read Time :
Write Time :
dn_6001_6002:
MPPDB CPU Time : 200 Jiffies
Host CPU Busy Time : 3490 Jiffies
Host CPU Total Time : 42330 Jiffies
MPPDB CPU Time % in Busy Time : 5.73 %
MPPDB CPU Time % in Total Time : .47 %
Physical memory : 8231776256 Bytes
DB Memory usage : 877236224 Bytes
Shared buffer size : 33554432 Bytes
Shared buffer hit ratio : 100.00 %
Sorts in memory : 123
Sorts in disk :
In-memory sort ratio : 100.00 %
Number of files : 149
Physical Reads :
Physical Writes :
Read Time :
Write Time :
dn_6003_6004:
MPPDB CPU Time : 170 Jiffies Host CPU Busy Time : 1030 Jiffies
Host CPU Total Time : 42470 Jiffies MPPDB CPU Time % in Busy Time : 16.50 %
MPPDB CPU Time % in Total Time : .40 %
Physical memory : 8231776256 Bytes
DB Memory usage : 881434624 Bytes Shared buffer size : 33554432 Bytes
Shared buffer hit ratio : 100.00 %
Sorts in memory : 119
Sorts in disk :
In-memory sort ratio : 100.00 %
Number of files : 165
Physical Reads :
Physical Writes :
Read Time :
Write Time :
dn_6005_6006:
MPPDB CPU Time : 220 Jiffies
Host CPU Busy Time : 1100 Jiffies
Host CPU Total Time : 42360 Jiffies
MPPDB CPU Time % in Busy Time : 20.00 %
MPPDB CPU Time % in Total Time : .52 %
Physical memory : 8231776256 Bytes
DB Memory usage : 881430528 Bytes
Shared buffer size : 33554432 Bytes
Shared buffer hit ratio : 100.00 %
Sorts in memory : 122
Sorts in disk :
In-memory sort ratio : 100.00 %
Number of files : 115
Physical Reads :
Physical Writes :
Read Time :
Write Time :
Session statistics information(Top 10):
Session CPU statistics:
1 dn_6003_6004-postgres-dbazt:
Session CPU time : 1211
Database CPU time : 37670
Session CPU time % : 3.21 %
2 dn_6005_6006-postgres-dbazt:
Session CPU time : 1204
Database CPU time : 35730
Session CPU time % : 3.37 %
3 dn_6001_6002-postgres-dbazt:
Session CPU time : 1064
Database CPU time : 34120
Session CPU time % : 3.12 %
4 cn_5001-postgres-dbazt:
Session CPU time : 1
Database CPU time : 17720
Session CPU time % : .01 %
Session Memory statistics:
1 dn_6005_6006-postgres-dbazt:
Buffer Reads : 8989
Shared Buffer Hit ratio : 96.97
In Memory sorts : 136
In Disk sorts :
In Memory sorts ratio : 100.00
Total Memory Size : 21593048
Used Memory Size : 18496600
2 dn_6003_6004-postgres-dbazt:
Buffer Reads : 9030
Shared Buffer Hit ratio : 96.94
In Memory sorts : 133
In Disk sorts :
In Memory sorts ratio : 100.00
Total Memory Size : 21576664
Used Memory Size : 18495688
3 dn_6001_6002-postgres-dbazt:
Buffer Reads : 8668
Shared Buffer Hit ratio : 96.97
In Memory sorts : 138
In Disk sorts :
In Memory sorts ratio : 100.00
Total Memory Size : 21258856
Used Memory Size : 18159736
4 cn_5001-postgres-dbazt:
Buffer Reads : 1339
Shared Buffer Hit ratio : 100.00
In Memory sorts :
In Disk sorts :
In Memory sorts ratio :
Total Memory Size : 17803144
Used Memory Size : 16488944
Session IO statistics:
1 dn_6003_6004-postgres-dbazt:
Physical Reads : 285
Read Time : 5320
2 dn_6005_6006-postgres-dbazt:
Physical Reads : 281
Read Time : 5811
3 dn_6001_6002-postgres-dbazt:
Physical Reads : 271
Read Time : 4662
4 cn_5001-postgres-dbazt:
Physical Reads :
Read Time : 来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3161275/ ,如需转载,请注明出处,否则将追究法律责任。