描述

    使用show proxystat [refresh] [like 'xx']语句:

    • 默认不带refresh时展示proxy内部上一次汇总的统计项,带refresh参数则强制执行一次本地统计项汇总更新后,再进行展示。
    • 支持like模糊匹配(支持’%’和_的匹配),默认不带like时展示全部的统计项。
    • 统计项persist_type值为PERSISTENT的表示该统计项会持久化更新到远程数据库的ob_all_proxy_stat表中。
    • 本地统计项默认stat_table_sync_interval更新一次,该配置项的默认值分别为60s。

    关键统计项

    • global_client_connections_currently_open 代表app到proxy的当前连接数。

    • global_connections_currently_open 代表app到proxy + proxy到observer的当前连接数。

    示例

    1. OceanBase (root@oceanbase)> show processlist;
    2. +------------+--------+------+--------------------+-----------+-------------+-------------------+-------------------+-------+-------+
    3. | Id | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
    4. +------------+--------+------+--------------------+-----------+-------------+-------------------+-------------------+-------+-------+
    5. | 2147549229 | sys | root | 10.125.111.4:48292 | oceanbase | 84 | 1 | MCS_ACTIVE_READER | 14531 | 14531 |
    6. +------------+--------+------+--------------------+-----------+-------------+-------------------+-------------------+-------+-------+
    7. 1 row in set (0.00 sec)
    8. OceanBase (root@oceanbase)> show proxystat;
    9. +----------------------------------------------------+-------------+--------------+
    10. | stat_name | value | persist_type |
    11. +----------------------------------------------------+-------------+--------------+
    12. | mysql__alive_congested_stat | 0 | NULL |
    13. | mysql__dead_congested_stat | 0 | NULL |
    14. | proxy__get_pl_from_remote_for_updating_stat | 0 | PERSISTENT |
    15. | proxy__get_pl_by_rs_list_succ_stat | 0 | PERSISTENT |
    16. | proxy__get_pl_by_last_session_succ_stat | 1039 | PERSISTENT |
    17. | proxy__get_pl_from_remote_fail_stat | 0 | PERSISTENT |
    18. | proxy__get_pl_from_remote_succ_stat | 0 | PERSISTENT |
    19. | proxy__get_pl_from_remote_stat | 0 | PERSISTENT |
    20. | proxy__get_pl_by_all_dummy_stat | 4 | PERSISTENT |
    21. | proxy__get_pl_from_cache_hit_stat | 4 | PERSISTENT |
    22. | proxy__get_pl_total_stat | 4 | PERSISTENT |
    23. | mysql__total_server_connect_time_stat | 3301634 | NULL |
    24. | mysql__total_pl_lookup_time_stat | 38511128 | NULL |
    25. | mysql__total_send_start_trans_time_stat | 0 | NULL |
    26. | mysql__total_send_last_insert_id_time_stat | 0 | NULL |
    27. | mysql__total_send_changed_session_vars_time_stat | 0 | NULL |
    28. | mysql__total_send_use_database_time_stat | 0 | NULL |
    29. | mysql__total_send_all_session_vars_time_stat | 0 | NULL |
    30. | mysql__total_send_saved_login_time_stat | 0 | NULL |
    31. | mysql__total_server_response_read_time_stat | 496287880 | NULL |
    32. | mysql__total_server_process_request_time_stat | 23198559799 | NULL |
    33. | mysql__total_client_request_analyze_time_stat | 135431530 | NULL |
    34. | mysql__total_client_response_write_time_stat | 0 | NULL |
    35. | mysql__total_client_request_read_time_stat | 205598668 | NULL |
    36. | mysql__total_transactions_time_stat | 25035477703 | PERSISTENT |
    37. | mysql__server_response_total_size_stat | 495653 | PERSISTENT |
    38. | mysql__server_request_total_size_stat | 780276 | PERSISTENT |
    39. | mysql__client_response_total_size_stat | 495888 | PERSISTENT |
    40. | mysql__client_request_total_size_stat | 779996 | PERSISTENT |
    41. | mysql__send_start_trans_requests_stat | 0 | NULL |
    42. | mysql__send_last_insert_id_requests_stat | 0 | PERSISTENT |
    43. | mysql__send_changed_session_vars_requests_stat | 0 | NULL |
    44. | mysql__send_use_database_requests_stat | 0 | NULL |
    45. | mysql__send_all_session_vars_requests_stat | 0 | NULL |
    46. | mysql__send_saved_login_requests_stat | 0 | PERSISTENT |
    47. | mysql__server_other_responses_stat | 4 | NULL |
    48. | mysql__server_ok_responses_stat | 220 | NULL |
    49. | mysql__server_resultset_responses_stat | 746 | NULL |
    50. | mysql__server_error_responses_stat | 77 | NULL |
    51. | mysql__server_requests_stat | 1043 | NULL |
    52. | mysql__server_responses_stat | 1047 | NULL |
    53. | mysql__broken_server_connections_stat | 0 | PERSISTENT |
    54. | mysql__server_pl_lookup_retries_stat | 0 | NULL |
    55. | mysql__server_pl_lookup_count_stat | 4 | NULL |
    56. | mysql__server_connect_retries_stat | 0 | NULL |
    57. | mysql__server_connect_count_stat | 4 | NULL |
    58. | mysql__server_speed_bytes_per_sec_100M_stat | 0 | NULL |
    59. | mysql__server_speed_bytes_per_sec_10M_stat | 371 | NULL |
    60. | mysql__server_speed_bytes_per_sec_1M_stat | 655 | NULL |
    61. | mysql__server_speed_bytes_per_sec_100K_stat | 16 | NULL |
    62. | mysql__server_speed_bytes_per_sec_10K_stat | 1 | NULL |
    63. | mysql__server_speed_bytes_per_sec_1K_stat | 0 | NULL |
    64. | mysql__server_speed_bytes_per_sec_100_stat | 0 | NULL |
    65. | mysql__client_speed_bytes_per_sec_100M_stat | 0 | NULL |
    66. | mysql__client_speed_bytes_per_sec_10M_stat | 0 | NULL |
    67. | mysql__client_speed_bytes_per_sec_1M_stat | 0 | NULL |
    68. | mysql__client_speed_bytes_per_sec_100K_stat | 0 | NULL |
    69. | mysql__client_speed_bytes_per_sec_10K_stat | 0 | NULL |
    70. | mysql__client_speed_bytes_per_sec_1K_stat | 0 | NULL |
    71. | mysql__client_speed_bytes_per_sec_100_stat | 0 | NULL |
    72. | mysql__response_size_inf_count_stat | 0 | NULL |
    73. | mysql__response_size_1M_count_stat | 0 | NULL |
    74. | mysql__response_size_10K_count_stat | 0 | NULL |
    75. | mysql__response_size_5K_count_stat | 0 | NULL |
    76. | mysql__response_size_3K_count_stat | 164 | NULL |
    77. | mysql__response_size_1K_count_stat | 581 | NULL |
    78. | mysql__response_size_100_count_stat | 303 | NULL |
    79. | mysql__request_size_inf_count_stat | 0 | NULL |
    80. | mysql__request_size_1M_count_stat | 53 | NULL |
    81. | mysql__request_size_10K_count_stat | 0 | NULL |
    82. | mysql__request_size_5K_count_stat | 0 | NULL |
    83. | mysql__request_size_3K_count_stat | 0 | NULL |
    84. | mysql__request_size_1K_count_stat | 697 | NULL |
    85. | mysql__request_size_100_count_stat | 298 | NULL |
    86. | mysql__client_other_requests_stat | 2 | NULL |
    87. | mysql__client_delete_requests_stat | 0 | NULL |
    88. | mysql__client_update_requests_stat | 163 | NULL |
    89. | mysql__client_insert_requests_stat | 53 | NULL |
    90. | mysql__client_select_requests_stat | 744 | NULL |
    91. | mysql__client_connection_abort_count_stat | 0 | NULL |
    92. | mysql__client_completed_requests_stat | 1048 | NULL |
    93. | mysql__client_missing_pk_requests_stat | 1043 | NULL |
    94. | mysql__client_internal_requests_stat | 5 | NULL |
    95. | mysql__client_large_requests_stat | 0 | NULL |
    96. | mysql__client_requests_stat | 1048 | NULL |
    97. | mysql__avg_transactions_per_server_connection | 0 | PERSISTENT |
    98. | mysql__avg_transactions_per_client_connection | 0 | PERSISTENT |
    99. | mysql__vip_to_tenant_cache_miss_stat | 0 | PERSISTENT |
    100. | mysql__vip_to_tenant_cache_hit_stat | 0 | PERSISTENT |
    101. | mysql__current_server_connections_stat | 4 | PERSISTENT |
    102. | mysql__total_server_connections_stat | 4 | PERSISTENT |
    103. | mysql__total_client_connections_ipv6_stat | 0 | NULL |
    104. | mysql__total_client_connections_ipv4_stat | 1 | NULL |
    105. | mysql__total_internal_client_connections_stat | 3 | PERSISTENT |
    106. | mysql__total_client_connections_stat | 1 | PERSISTENT |
    107. | mysql__current_server_transactions_stat | 0 | PERSISTENT |
    108. | mysql__current_client_transactions_stat | 0 | PERSISTENT |
    109. | mysql__current_active_client_connections_stat | 0 | PERSISTENT |
    110. | mysql__current_client_connections_stat | 4 | PERSISTENT |
    111. | mysql__total_transaction_count_stat | 1044 | NULL |
    112. | net__default_inactivity_timeout | 0 | NULL |
    113. | net__keep_alive_lru_timeout_count | 0 | NULL |
    114. | net__keep_alive_lru_timeout_total | 0 | NULL |
    115. | net__inactivity_cop_lock_acquire_failure | 0 | NULL |
    116. | net__calls_to_write_nodata | 0 | NULL |
    117. | net__calls_to_write | 1127 | NULL |
    118. | net__calls_to_writetonet | 1131 | NULL |
    119. | net__calls_to_read_nodata | 4 | NULL |
    120. | net__calls_to_read | 1134 | NULL |
    121. | net__calls_to_readfromnet | 1134 | NULL |
    122. | net__global_accepts_currently_open | 2 | PERSISTENT |
    123. | net__global_connections_currently_open | 5 | PERSISTENT |
    124. | net__global_client_connections_currently_open_stat | 1 | PERSISTENT |
    125. | net__client_connections_currently_open | 1 | NULL |
    126. | net__write_bytes | 786102 | PERSISTENT |
    127. | net__read_bytes | 514392 | PERSISTENT |
    128. | net__net_handler_run | 1937335 | NULL |
    129. +----------------------------------------------------+-------------+--------------+
    130. 117 rows in set (0.00 sec)
    131. OceanBase (root@oceanbase)> show proxystat refresh like '%total%';
    132. +--------------------------------------------------+-------------+--------------+
    133. | stat_name | value | persist_type |
    134. +--------------------------------------------------+-------------+--------------+
    135. | proxy__get_pl_total_stat | 4 | PERSISTENT |
    136. | mysql__total_server_connect_time_stat | 3301634 | NULL |
    137. | mysql__total_pl_lookup_time_stat | 38511128 | NULL |
    138. | mysql__total_send_start_trans_time_stat | 0 | NULL |
    139. | mysql__total_send_last_insert_id_time_stat | 0 | NULL |
    140. | mysql__total_send_changed_session_vars_time_stat | 0 | NULL |
    141. | mysql__total_send_use_database_time_stat | 0 | NULL |
    142. | mysql__total_send_all_session_vars_time_stat | 0 | NULL |
    143. | mysql__total_send_saved_login_time_stat | 0 | NULL |
    144. | mysql__total_server_response_read_time_stat | 503418949 | NULL |
    145. | mysql__total_server_process_request_time_stat | 23716596431 | NULL |
    146. | mysql__total_client_request_analyze_time_stat | 137932059 | NULL |
    147. | mysql__total_client_response_write_time_stat | 0 | NULL |
    148. | mysql__total_client_request_read_time_stat | 209417696 | NULL |
    149. | mysql__total_transactions_time_stat | 25588921524 | PERSISTENT |
    150. | mysql__server_response_total_size_stat | 504473 | PERSISTENT |
    151. | mysql__server_request_total_size_stat | 794521 | PERSISTENT |
    152. | mysql__client_response_total_size_stat | 511316 | PERSISTENT |
    153. | mysql__client_request_total_size_stat | 794281 | PERSISTENT |
    154. | mysql__total_server_connections_stat | 4 | PERSISTENT |
    155. | mysql__total_client_connections_ipv6_stat | 0 | NULL |
    156. | mysql__total_client_connections_ipv4_stat | 1 | NULL |
    157. | mysql__total_internal_client_connections_stat | 3 | PERSISTENT |
    158. | mysql__total_client_connections_stat | 1 | PERSISTENT |
    159. | mysql__total_transaction_count_stat | 1064 | NULL |
    160. | net__keep_alive_lru_timeout_total | 0 | NULL |
    161. +--------------------------------------------------+-------------+--------------+
    162. 26 rows in set (0.00 sec)