gs_checkperf

    前提条件

    • openGauss运行状态正常且不为只读模式。
    • 运行在数据库之上的业务运行正常。
    • gs_checkperf工具的监控信息依赖于pmk模式下的表的数据。如果pmk模式下的表未执行analyze操作,则可能导致gs_checkperf工具执行失败。其报错示例信息如下:

      此时需要登录任一数据库主节点,连接postgres数据库执行如下SQL:

      1. analyze pmk.pmk_meta_data;
      2. analyze pmk.pmk_snapshot;
      3. analyze pmk.pmk_snapshot_dbnode_stat;
      4. analyze pmk.pmk_snapshot_datanode_stat;

    语法

    • 检查SSD性能(root用户)

    • 检查openGauss性能(openGauss安装用户)

      1. gs_checkperf [-U USER] [-o OUTPUT] [-i PMK] [--detail] [-l LOGFILE]
    • 显示帮助信息

    • 显示版本号信息

      1. gs_checkperf -V | --version
    • -U

      运行openGauss的用户名称。

      取值范围:运行openGauss的用户名称。

      以root用户身份执行此命令必须指定该参数。

    • -o

      指定性能检查报告输出到指定的文件。

      取值范围:指定的文件名称。

      不指定则将检查结果输出到屏幕上。

    • -i

      指定检查项编号,-i参数值不区分大小写。格式:-i PMK、-i SSD。

      取值范围:PMK、SSD

      只有openGauss用户才能检查PMK选项。

      只有root用户才能检查SSD选项。

      如果不指定该参数,以openGauss用户身份默认检查PMK,以root用户身份默认检查SSD。

    • –detail

      显示PMK检查结果详情。

    • 指定日志文件的存储路径。

      默认路径为:/var/log/gaussdb/omm/om/gs_checkperf-YYYY-MM-DD_hhmmss.log

    • -?, –help

      显示帮助信息。

    • -V, –version

      显示版本号信息。

    表 1 性能检查项

    示例

    示例一:以简要格式在屏幕上显示性能统计结果。

    1. gs_checkperf -i pmk -U omm --detail
    2. Cluster statistics information:
    3. Host CPU usage rate:
    4. Host total CPU time : 42386.667 Jiffies
    5. Host CPU busy time : 1873.333 Jiffies
    6. Host CPU iowait time : 20.000 Jiffies
    7. Host CPU busy time ratio : 4.42 %
    8. Host CPU iowait time ratio : .05 %
    9. GaussDB CPU usage rate:
    10. GaussDB CPU time % in busy time : 19.04 %
    11. GaussDB CPU time % in total time : .84 %
    12. Shared buffer hit rate:
    13. Shared Buffer Reads : 0
    14. Shared Buffer Hits : 24129
    15. Shared Buffer Hit ratio : 100.00 % In-memory sort ratio : 100.00 %I/O usage:
    16. Number of files : 537
    17. Physical Reads : 0
    18. Physical Writes : 0
    19. Read Time : 0 ms
    20. Write Time : 0 ms
    21. Disk usage:
    22. DB size : 70 MB
    23. Total Physical writes : 0
    24. Average Physical write : 0
    25. Activity statistics:
    26. Active SQL count : 2
    27. Session count : 3
    28. Node statistics information:
    29. dn_6001_6002:
    30. GaussDB CPU Time : 200 Jiffies
    31. Host CPU Busy Time : 3490 Jiffies
    32. Host CPU Total Time : 42330 Jiffies
    33. GaussDB CPU Time % in Busy Time : 5.73 %
    34. GaussDB CPU Time % in Total Time : .47 %
    35. Physical memory : 8231776256 Bytes
    36. DB Memory usage : 877236224 Bytes
    37. Shared buffer size : 33554432 Bytes
    38. Shared buffer hit ratio : 100.00 %
    39. Sorts in disk : 0
    40. In-memory sort ratio : 100.00 %
    41. Number of files : 149
    42. Physical Reads : 0
    43. Physical Writes : 0
    44. Read Time : 0
    45. Write Time : 0
    46. dn_6003_6004:
    47. GaussDB CPU Time : 170 Jiffies Host CPU Busy Time : 1030 Jiffies
    48. Host CPU Total Time : 42470 Jiffies GaussDB CPU Time % in Busy Time : 16.50 %
    49. GaussDB CPU Time % in Total Time : .40 %
    50. Physical memory : 8231776256 Bytes
    51. DB Memory usage : 881434624 Bytes Shared buffer size : 33554432 Bytes
    52. Shared buffer hit ratio : 100.00 %
    53. Sorts in memory : 119
    54. Sorts in disk : 0
    55. In-memory sort ratio : 100.00 %
    56. Number of files : 165
    57. Physical Reads : 0
    58. Physical Writes : 0
    59. Read Time : 0
    60. Write Time : 0
    61. dn_6005_6006:
    62. GaussDB CPU Time : 220 Jiffies
    63. Host CPU Busy Time : 1100 Jiffies
    64. Host CPU Total Time : 42360 Jiffies
    65. GaussDB CPU Time % in Busy Time : 20.00 %
    66. GaussDB CPU Time % in Total Time : .52 %
    67. Physical memory : 8231776256 Bytes
    68. DB Memory usage : 881430528 Bytes
    69. Shared buffer size : 33554432 Bytes
    70. Shared buffer hit ratio : 100.00 %
    71. Sorts in memory : 122
    72. Sorts in disk : 0
    73. In-memory sort ratio : 100.00 %
    74. Number of files : 115
    75. Physical Reads : 0
    76. Read Time : 0
    77. Write Time : 0
    78. Session statistics information(Top 10):
    79. Session CPU statistics:
    80. 1 dn_6003_6004-postgres-dbazt:
    81. Session CPU time : 1211
    82. Database CPU time : 37670
    83. 2 dn_6005_6006-postgres-dbazt:
    84. Session CPU time : 1204
    85. Database CPU time : 35730
    86. Session CPU time % : 3.37 %
    87. 3 dn_6001_6002-postgres-dbazt:
    88. Session CPU time : 1064
    89. Database CPU time : 34120
    90. Session CPU time % : 3.12 %
    91. Session Memory statistics:
    92. 1 dn_6005_6006-postgres-dbazt:
    93. Buffer Reads : 8989
    94. Shared Buffer Hit ratio : 96.97
    95. In Memory sorts : 136
    96. In Disk sorts : 0
    97. In Memory sorts ratio : 100.00
    98. Total Memory Size : 21593048
    99. Used Memory Size : 18496600
    100. 2 dn_6003_6004-postgres-dbazt:
    101. Buffer Reads : 9030
    102. Shared Buffer Hit ratio : 96.94
    103. In Memory sorts : 133
    104. In Disk sorts : 0
    105. In Memory sorts ratio : 100.00
    106. Total Memory Size : 21576664
    107. Used Memory Size : 18495688
    108. 3 dn_6001_6002-postgres-dbazt:
    109. Buffer Reads : 8668
    110. Shared Buffer Hit ratio : 96.97
    111. In Memory sorts : 138
    112. In Disk sorts : 0
    113. In Memory sorts ratio : 100.00
    114. Total Memory Size : 21258856
    115. Used Memory Size : 18159736
    116. Session IO statistics:
    117. 1 dn_6003_6004-postgres-dbazt:
    118. Physical Reads : 285
    119. Read Time : 5320
    120. 2 dn_6005_6006-postgres-dbazt:
    121. Physical Reads : 281
    122. Read Time : 5811
    123. 3 dn_6001_6002-postgres-dbazt:
    124. Physical Reads : 271

    gs_checkos