Loading...
MySQL 9.5 Reference Manual 9.5의 25.6.14 NDB API Statistics Counters and Variables의 한국어 번역본입니다.
아래의 경우에 피드백에서 신고해주신다면 반영하겠습니다.
감사합니다 :)
Ndb 객체에 의해 수행되거나 영향을 받는 동작과 관련된 여러 유형의 통계 카운터가 제공됩니다. 이러한 동작에는 트랜잭션의 시작 및 종료(또는 중단), 프라이머리 키 및 유니크 키 작업, 테이블, 범위, 프루닝된 스캔, 다양한 작업의 완료를 기다리는 동안 블록된 스레드, NDBCLUSTER에 의해 송수신되는 데이터 및 이벤트 등이 포함됩니다. 이 카운터들은 NDB API 호출이 이루어지거나 데이터 노드로 데이터가 전송되거나 데이터 노드로부터 데이터가 수신될 때마다 NDB 커널 내부에서 증가합니다. mysqld는 이 카운터들을 시스템 상태 변수로 노출합니다. 이러한 값은 SHOW STATUS의 출력에서 읽거나 Performance Schema session_status 또는 global_status 테이블을 조회하여 읽을 수 있습니다. NDB 테이블에서 동작하는 문장 전후의 값을 비교하면 API 레벨에서 수행된 해당 동작과, 따라서 문장을 수행하는 데 드는 코스트를 관찰할 수 있습니다.
다음 SHOW STATUS 문장을 사용하여 이 상태 변수들을 모두 나열할 수 있습니다:
1mysql> SHOW STATUS LIKE 'ndb_api%'; 2+----------------------------------------------+-------------+ 3| Variable_name | Value | 4+----------------------------------------------+-------------+ 5| Ndb_api_wait_exec_complete_count | 11 | 6| Ndb_api_wait_scan_result_count | 14 | 7| Ndb_api_wait_meta_request_count | 74 | 8| Ndb_api_wait_nanos_count | 31453031678 | 9| Ndb_api_bytes_sent_count | 3336 | 10| Ndb_api_bytes_received_count | 103568 | 11| Ndb_api_trans_start_count | 10 | 12| Ndb_api_trans_commit_count | 2 | 13| Ndb_api_trans_abort_count | 4 | 14| Ndb_api_trans_close_count | 10 | 15| Ndb_api_pk_op_count | 6 | 16| Ndb_api_uk_op_count | 0 | 17| Ndb_api_table_scan_count | 3 | 18| Ndb_api_range_scan_count | 1 | 19| Ndb_api_pruned_scan_count | 0 | 20| Ndb_api_scan_batch_count | 3 | 21| Ndb_api_read_row_count | 11 | 22| Ndb_api_trans_local_read_row_count | 9 | 23| Ndb_api_adaptive_send_forced_count | 5 | 24| Ndb_api_adaptive_send_unforced_count | 11 | 25| Ndb_api_adaptive_send_deferred_count | 0 | 26| Ndb_api_event_data_count | 0 | 27| Ndb_api_event_nondata_count | 0 | 28| Ndb_api_event_bytes_count | 0 | 29| Ndb_api_event_data_count_injector | 0 | 30| Ndb_api_event_nondata_count_injector | 0 | 31| Ndb_api_event_bytes_count_injector | 0 | 32| Ndb_api_wait_exec_complete_count_slave | 0 | 33| Ndb_api_wait_scan_result_count_slave | 0 | 34| Ndb_api_wait_meta_request_count_slave | 0 | 35| Ndb_api_wait_nanos_count_slave | 0 | 36| Ndb_api_bytes_sent_count_slave | 0 | 37| Ndb_api_bytes_received_count_slave | 0 | 38| Ndb_api_trans_start_count_slave | 0 | 39| Ndb_api_trans_commit_count_slave | 0 | 40| Ndb_api_trans_abort_count_slave | 0 | 41| Ndb_api_trans_close_count_slave | 0 | 42| Ndb_api_pk_op_count_slave | 0 | 43| Ndb_api_uk_op_count_slave | 0 | 44| Ndb_api_table_scan_count_slave | 0 | 45| Ndb_api_range_scan_count_slave | 0 | 46| Ndb_api_pruned_scan_count_slave | 0 | 47| Ndb_api_scan_batch_count_slave | 0 | 48| Ndb_api_read_row_count_slave | 0 | 49| Ndb_api_trans_local_read_row_count_slave | 0 | 50| Ndb_api_adaptive_send_forced_count_slave | 0 | 51| Ndb_api_adaptive_send_unforced_count_slave | 0 | 52| Ndb_api_adaptive_send_deferred_count_slave | 0 | 53| Ndb_api_wait_exec_complete_count_replica | 0 | 54| Ndb_api_wait_scan_result_count_replica | 0 | 55| Ndb_api_wait_meta_request_count_replica | 0 | 56| Ndb_api_wait_nanos_count_replica | 0 | 57| Ndb_api_bytes_sent_count_replica | 0 | 58| Ndb_api_bytes_received_count_replica | 0 | 59| Ndb_api_trans_start_count_replica | 0 | 60| Ndb_api_trans_commit_count_replica | 0 | 61| Ndb_api_trans_abort_count_replica | 0 | 62| Ndb_api_trans_close_count_replica | 0 | 63| Ndb_api_pk_op_count_replica | 0 | 64| Ndb_api_uk_op_count_replica | 0 | 65| Ndb_api_table_scan_count_replica | 0 | 66| Ndb_api_range_scan_count_replica | 0 | 67| Ndb_api_pruned_scan_count_replica | 0 | 68| Ndb_api_scan_batch_count_replica | 0 | 69| Ndb_api_read_row_count_replica | 0 | 70| Ndb_api_trans_local_read_row_count_replica | 0 | 71| Ndb_api_adaptive_send_forced_count_replica | 0 | 72| Ndb_api_adaptive_send_unforced_count_replica | 0 | 73| Ndb_api_adaptive_send_deferred_count_replica | 0 | 74| Ndb_api_wait_exec_complete_count_session | 0 | 75| Ndb_api_wait_scan_result_count_session | 3 | 76| Ndb_api_wait_meta_request_count_session | 6 | 77| Ndb_api_wait_nanos_count_session | 2022486 | 78| Ndb_api_bytes_sent_count_session | 268 | 79| Ndb_api_bytes_received_count_session | 10332 | 80| Ndb_api_trans_start_count_session | 1 | 81| Ndb_api_trans_commit_count_session | 0 | 82| Ndb_api_trans_abort_count_session | 0 | 83| Ndb_api_trans_close_count_session | 1 | 84| Ndb_api_pk_op_count_session | 0 | 85| Ndb_api_uk_op_count_session | 0 | 86| Ndb_api_table_scan_count_session | 1 | 87| Ndb_api_range_scan_count_session | 0 | 88| Ndb_api_pruned_scan_count_session | 0 | 89| Ndb_api_scan_batch_count_session | 2 | 90| Ndb_api_read_row_count_session | 2 | 91| Ndb_api_trans_local_read_row_count_session | 2 | 92| Ndb_api_adaptive_send_forced_count_session | 1 | 93| Ndb_api_adaptive_send_unforced_count_session | 0 | 94| Ndb_api_adaptive_send_deferred_count_session | 0 | 95+----------------------------------------------+-------------+ 9690 rows in set (0.00 sec)
이 상태 변수들은 Performance Schema의 session_status 및 global_status 테이블에서도 다음과 같이 사용할 수 있습니다:
1mysql> SELECT * FROM performance_schema.session_status 2 -> WHERE VARIABLE_NAME LIKE 'ndb_api%'; 3+----------------------------------------------+----------------+ 4| VARIABLE_NAME | VARIABLE_VALUE | 5+----------------------------------------------+----------------+ 6| Ndb_api_wait_exec_complete_count | 11 | 7| Ndb_api_wait_scan_result_count | 14 | 8| Ndb_api_wait_meta_request_count | 81 | 9| Ndb_api_wait_nanos_count | 119485762051 | 10| Ndb_api_bytes_sent_count | 3476 | 11| Ndb_api_bytes_received_count | 105372 | 12| Ndb_api_trans_start_count | 10 | 13| Ndb_api_trans_commit_count | 2 | 14| Ndb_api_trans_abort_count | 4 | 15| Ndb_api_trans_close_count | 10 | 16| Ndb_api_pk_op_count | 6 | 17| Ndb_api_uk_op_count | 0 | 18| Ndb_api_table_scan_count | 3 | 19| Ndb_api_range_scan_count | 1 | 20| Ndb_api_pruned_scan_count | 0 | 21| Ndb_api_scan_batch_count | 3 | 22| Ndb_api_read_row_count | 11 | 23| Ndb_api_trans_local_read_row_count | 9 | 24| Ndb_api_adaptive_send_forced_count | 5 | 25| Ndb_api_adaptive_send_unforced_count | 11 | 26| Ndb_api_adaptive_send_deferred_count | 0 | 27| Ndb_api_event_data_count | 0 | 28| Ndb_api_event_nondata_count | 0 | 29| Ndb_api_event_bytes_count | 0 | 30| Ndb_api_event_data_count_injector | 0 | 31| Ndb_api_event_nondata_count_injector | 0 | 32| Ndb_api_event_bytes_count_injector | 0 | 33| Ndb_api_wait_exec_complete_count_slave | 0 | 34| Ndb_api_wait_scan_result_count_slave | 0 | 35| Ndb_api_wait_meta_request_count_slave | 0 | 36| Ndb_api_wait_nanos_count_slave | 0 | 37| Ndb_api_bytes_sent_count_slave | 0 | 38| Ndb_api_bytes_received_count_slave | 0 | 39| Ndb_api_trans_start_count_slave | 0 | 40| Ndb_api_trans_commit_count_slave | 0 | 41| Ndb_api_trans_abort_count_slave | 0 | 42| Ndb_api_trans_close_count_slave | 0 | 43| Ndb_api_pk_op_count_slave | 0 | 44| Ndb_api_uk_op_count_slave | 0 | 45| Ndb_api_table_scan_count_slave | 0 | 46| Ndb_api_range_scan_count_slave | 0 | 47| Ndb_api_pruned_scan_count_slave | 0 | 48| Ndb_api_scan_batch_count_slave | 0 | 49| Ndb_api_read_row_count_slave | 0 | 50| Ndb_api_trans_local_read_row_count_slave | 0 | 51| Ndb_api_adaptive_send_forced_count_slave | 0 | 52| Ndb_api_adaptive_send_unforced_count_slave | 0 | 53| Ndb_api_adaptive_send_deferred_count_slave | 0 | 54| Ndb_api_wait_exec_complete_count_replica | 0 | 55| Ndb_api_wait_scan_result_count_replica | 0 | 56| Ndb_api_wait_meta_request_count_replica | 0 | 57| Ndb_api_wait_nanos_count_replica | 0 | 58| Ndb_api_bytes_sent_count_replica | 0 | 59| Ndb_api_bytes_received_count_replica | 0 | 60| Ndb_api_trans_start_count_replica | 0 | 61| Ndb_api_trans_commit_count_replica | 0 | 62| Ndb_api_trans_abort_count_replica | 0 | 63| Ndb_api_trans_close_count_replica | 0 | 64| Ndb_api_pk_op_count_replica | 0 | 65| Ndb_api_uk_op_count_replica | 0 | 66| Ndb_api_table_scan_count_replica | 0 | 67| Ndb_api_range_scan_count_replica | 0 | 68| Ndb_api_pruned_scan_count_replica | 0 | 69| Ndb_api_scan_batch_count_replica | 0 | 70| Ndb_api_read_row_count_replica | 0 | 71| Ndb_api_trans_local_read_row_count_replica | 0 | 72| Ndb_api_adaptive_send_forced_count_replica | 0 | 73| Ndb_api_adaptive_send_unforced_count_replica | 0 | 74| Ndb_api_adaptive_send_deferred_count_replica | 0 | 75| Ndb_api_wait_exec_complete_count_session | 0 | 76| Ndb_api_wait_scan_result_count_session | 3 | 77| Ndb_api_wait_meta_request_count_session | 6 | 78| Ndb_api_wait_nanos_count_session | 2022486 | 79| Ndb_api_bytes_sent_count_session | 268 | 80| Ndb_api_bytes_received_count_session | 10332 | 81| Ndb_api_trans_start_count_session | 1 | 82| Ndb_api_trans_commit_count_session | 0 | 83| Ndb_api_trans_abort_count_session | 0 | 84| Ndb_api_trans_close_count_session | 1 | 85| Ndb_api_pk_op_count_session | 0 | 86| Ndb_api_uk_op_count_session | 0 | 87| Ndb_api_table_scan_count_session | 1 | 88| Ndb_api_range_scan_count_session | 0 | 89| Ndb_api_pruned_scan_count_session | 0 | 90| Ndb_api_scan_batch_count_session | 2 | 91| Ndb_api_read_row_count_session | 2 | 92| Ndb_api_trans_local_read_row_count_session | 2 | 93| Ndb_api_adaptive_send_forced_count_session | 1 | 94| Ndb_api_adaptive_send_unforced_count_session | 0 | 95| Ndb_api_adaptive_send_deferred_count_session | 0 | 96+----------------------------------------------+----------------+ 9790 rows in set (0.00 sec) 98 99mysql> SELECT * FROM performance_schema.global_status 100 -> WHERE VARIABLE_NAME LIKE 'ndb_api%'; 101+----------------------------------------------+----------------+ 102| VARIABLE_NAME | VARIABLE_VALUE | 103+----------------------------------------------+----------------+ 104| Ndb_api_wait_exec_complete_count | 11 | 105| Ndb_api_wait_scan_result_count | 14 | 106| Ndb_api_wait_meta_request_count | 88 | 107| Ndb_api_wait_nanos_count | 159810484729 | 108| Ndb_api_bytes_sent_count | 3616 | 109| Ndb_api_bytes_received_count | 107176 | 110| Ndb_api_trans_start_count | 10 | 111| Ndb_api_trans_commit_count | 2 | 112| Ndb_api_trans_abort_count | 4 | 113| Ndb_api_trans_close_count | 10 | 114| Ndb_api_pk_op_count | 6 | 115| Ndb_api_uk_op_count | 0 | 116| Ndb_api_table_scan_count | 3 | 117| Ndb_api_range_scan_count | 1 | 118| Ndb_api_pruned_scan_count | 0 | 119| Ndb_api_scan_batch_count | 3 | 120| Ndb_api_read_row_count | 11 | 121| Ndb_api_trans_local_read_row_count | 9 | 122| Ndb_api_adaptive_send_forced_count | 5 | 123| Ndb_api_adaptive_send_unforced_count | 11 | 124| Ndb_api_adaptive_send_deferred_count | 0 | 125| Ndb_api_event_data_count | 0 | 126| Ndb_api_event_nondata_count | 0 | 127| Ndb_api_event_bytes_count | 0 | 128| Ndb_api_event_data_count_injector | 0 | 129| Ndb_api_event_nondata_count_injector | 0 | 130| Ndb_api_event_bytes_count_injector | 0 | 131| Ndb_api_wait_exec_complete_count_slave | 0 | 132| Ndb_api_wait_scan_result_count_slave | 0 | 133| Ndb_api_wait_meta_request_count_slave | 0 | 134| Ndb_api_wait_nanos_count_slave | 0 | 135| Ndb_api_bytes_sent_count_slave | 0 | 136| Ndb_api_bytes_received_count_slave | 0 | 137| Ndb_api_trans_start_count_slave | 0 | 138| Ndb_api_trans_commit_count_slave | 0 | 139| Ndb_api_trans_abort_count_slave | 0 | 140| Ndb_api_trans_close_count_slave | 0 | 141| Ndb_api_pk_op_count_slave | 0 | 142| Ndb_api_uk_op_count_slave | 0 | 143| Ndb_api_table_scan_count_slave | 0 | 144| Ndb_api_range_scan_count_slave | 0 | 145| Ndb_api_pruned_scan_count_slave | 0 | 146| Ndb_api_scan_batch_count_slave | 0 | 147| Ndb_api_read_row_count_slave | 0 | 148| Ndb_api_trans_local_read_row_count_slave | 0 | 149| Ndb_api_adaptive_send_forced_count_slave | 0 | 150| Ndb_api_adaptive_send_unforced_count_slave | 0 | 151| Ndb_api_adaptive_send_deferred_count_slave | 0 | 152| Ndb_api_wait_exec_complete_count_replica | 0 | 153| Ndb_api_wait_scan_result_count_replica | 0 | 154| Ndb_api_wait_meta_request_count_replica | 0 | 155| Ndb_api_wait_nanos_count_replica | 0 | 156| Ndb_api_bytes_sent_count_replica | 0 | 157| Ndb_api_bytes_received_count_replica | 0 | 158| Ndb_api_trans_start_count_replica | 0 | 159| Ndb_api_trans_commit_count_replica | 0 | 160| Ndb_api_trans_abort_count_replica | 0 | 161| Ndb_api_trans_close_count_replica | 0 | 162| Ndb_api_pk_op_count_replica | 0 | 163| Ndb_api_uk_op_count_replica | 0 | 164| Ndb_api_table_scan_count_replica | 0 | 165| Ndb_api_range_scan_count_replica | 0 | 166| Ndb_api_pruned_scan_count_replica | 0 | 167| Ndb_api_scan_batch_count_replica | 0 | 168| Ndb_api_read_row_count_replica | 0 | 169| Ndb_api_trans_local_read_row_count_replica | 0 | 170| Ndb_api_adaptive_send_forced_count_replica | 0 | 171| Ndb_api_adaptive_send_unforced_count_replica | 0 | 172| Ndb_api_adaptive_send_deferred_count_replica | 0 | 173| Ndb_api_wait_exec_complete_count_session | 0 | 174| Ndb_api_wait_scan_result_count_session | 3 | 175| Ndb_api_wait_meta_request_count_session | 6 | 176| Ndb_api_wait_nanos_count_session | 2022486 | 177| Ndb_api_bytes_sent_count_session | 268 | 178| Ndb_api_bytes_received_count_session | 10332 | 179| Ndb_api_trans_start_count_session | 1 | 180| Ndb_api_trans_commit_count_session | 0 | 181| Ndb_api_trans_abort_count_session | 0 | 182| Ndb_api_trans_close_count_session | 1 | 183| Ndb_api_pk_op_count_session | 0 | 184| Ndb_api_uk_op_count_session | 0 | 185| Ndb_api_table_scan_count_session | 1 | 186| Ndb_api_range_scan_count_session | 0 | 187| Ndb_api_pruned_scan_count_session | 0 | 188| Ndb_api_scan_batch_count_session | 2 | 189| Ndb_api_read_row_count_session | 2 | 190| Ndb_api_trans_local_read_row_count_session | 2 | 191| Ndb_api_adaptive_send_forced_count_session | 1 | 192| Ndb_api_adaptive_send_unforced_count_session | 0 | 193| Ndb_api_adaptive_send_deferred_count_session | 0 | 194+----------------------------------------------+----------------+ 19590 rows in set (0.01 sec)
각 Ndb 객체는 자체 카운터를 가집니다. NDB API 애플리케이션은 최적화 또는 모니터링에 사용하기 위해 이 카운터 값들을 읽을 수 있습니다. 둘 이상의 Ndb 객체를 동시에 사용하는 멀티스레드 클라이언트의 경우, 특정 Ndb_cluster_connection에 속한 모든 Ndb 객체의 카운터에 대한 합산된 뷰를 얻는 것도 가능합니다.
이러한 카운터는 네 개의 집합으로 노출됩니다. 하나는 현재 세션에만 적용되고, 나머지 세 개는 글로벌입니다. 이는 mysql 클라이언트에서 이 값들을 세션 또는 글로벌 상태 변수로 얻을 수 있다는 사실에도 불구하고 그렇습니다. 이는 SHOW STATUS에서 SESSION 또는 GLOBAL 키워드를 지정해도 NDB API 통계 상태 변수에 대해 보고되는 값에는 아무런 영향이 없으며, 이러한 각 변수의 값은 해당 값을 session_status 테이블의 해당 컬럼에서 얻든, global_status 테이블에서 얻든 동일하다는 것을 의미합니다.
Session 카운터는 현재 세션에서만 사용 중인 Ndb 객체와 관련됩니다. 다른 MySQL 클라이언트에 의한 이러한 객체의 사용은 이 카운트에 영향을 주지 않습니다.
표준 MySQL 세션 변수와의 혼동을 최소화하기 위해, 이러한 NDB API 세션 카운터에 해당하는 변수를 앞에 언더스코어가 붙은 “_session 변수”라고 부릅니다.
이 카운터 집합은 레플리카 SQL 스레드(있는 경우)에서 사용하는 Ndb 객체와 관련됩니다. 이 mysqld가 레플리카로 동작하지 않거나 NDB 테이블을 사용하지 않는다면 이 카운트는 모두 0입니다.
우리는 관련 상태 변수를 앞에 언더스코어가 붙은 “_replica 변수”라고 부릅니다.
Injector 카운터는 바이너리 로그 인젝터 스레드가 클러스터 이벤트를 리슨하는 데 사용하는 Ndb 객체와 관련됩니다. 바이너리 로그를 쓰지 않는 경우에도, NDB Cluster에 연결된 mysqld 프로세스는 스키마 변경과 같은 일부 이벤트를 계속해서 리슨합니다.
우리는 NDB API injector 카운터에 해당하는 상태 변수를 앞에 언더스코어가 붙은 “_injector 변수”라고 부릅니다.
이 카운터 집합은 현재 이 mysqld에서 사용 중인 모든 Ndb 객체와 관련됩니다. 여기에는 모든 MySQL 클라이언트 애플리케이션, 레플리카 SQL 스레드(있는 경우), 바이너리 로그 인젝터, NDB 유틸리티 스레드가 포함됩니다.
우리는 이러한 카운터에 해당하는 상태 변수를 “글로벌 변수” 또는 “mysqld-레벨 변수”라고 부릅니다.
특정 변수 집합의 값을 얻기 위해, 변수 이름에서 공통 프리픽스 Ndb_api와 함께 session, replica, 또는 injector 서브스트링을 추가로 필터할 수 있습니다. _session 변수의 경우 다음과 같이 할 수 있습니다:
1mysql> SHOW STATUS LIKE 'ndb_api%session'; 2+----------------------------------------------+---------+ 3| Variable_name | Value | 4+----------------------------------------------+---------+ 5| Ndb_api_wait_exec_complete_count_session | 0 | 6| Ndb_api_wait_scan_result_count_session | 3 | 7| Ndb_api_wait_meta_request_count_session | 6 | 8| Ndb_api_wait_nanos_count_session | 2022486 | 9| Ndb_api_bytes_sent_count_session | 268 | 10| Ndb_api_bytes_received_count_session | 10332 | 11| Ndb_api_trans_start_count_session | 1 | 12| Ndb_api_trans_commit_count_session | 0 | 13| Ndb_api_trans_abort_count_session | 0 | 14| Ndb_api_trans_close_count_session | 1 | 15| Ndb_api_pk_op_count_session | 0 | 16| Ndb_api_uk_op_count_session | 0 | 17| Ndb_api_table_scan_count_session | 1 | 18| Ndb_api_range_scan_count_session | 0 | 19| Ndb_api_pruned_scan_count_session | 0 | 20| Ndb_api_scan_batch_count_session | 2 | 21| Ndb_api_read_row_count_session | 2 | 22| Ndb_api_trans_local_read_row_count_session | 2 | 23| Ndb_api_adaptive_send_forced_count_session | 1 | 24| Ndb_api_adaptive_send_unforced_count_session | 0 | 25| Ndb_api_adaptive_send_deferred_count_session | 0 | 26+----------------------------------------------+---------+ 2721 rows in set (0.00 sec)
NDB API mysqld-레벨 상태 변수의 목록을 얻으려면, 변수 이름이 ndb_api로 시작하고 _count로 끝나는 항목을 다음과 같이 필터하면 됩니다:
1mysql> SELECT * FROM performance_schema.session_status 2 -> WHERE VARIABLE_NAME LIKE 'ndb_api%count'; 3+------------------------------------+----------------+ 4| VARIABLE_NAME | VARIABLE_VALUE | 5+------------------------------------+----------------+ 6| NDB_API_WAIT_EXEC_COMPLETE_COUNT | 4 | 7| NDB_API_WAIT_SCAN_RESULT_COUNT | 3 | 8| NDB_API_WAIT_META_REQUEST_COUNT | 28 | 9| NDB_API_WAIT_NANOS_COUNT | 53756398 | 10| NDB_API_BYTES_SENT_COUNT | 1060 | 11| NDB_API_BYTES_RECEIVED_COUNT | 9724 | 12| NDB_API_TRANS_START_COUNT | 3 | 13| NDB_API_TRANS_COMMIT_COUNT | 2 | 14| NDB_API_TRANS_ABORT_COUNT | 0 | 15| NDB_API_TRANS_CLOSE_COUNT | 3 | 16| NDB_API_PK_OP_COUNT | 2 | 17| NDB_API_UK_OP_COUNT | 0 | 18| NDB_API_TABLE_SCAN_COUNT | 1 | 19| NDB_API_RANGE_SCAN_COUNT | 0 | 20| NDB_API_PRUNED_SCAN_COUNT | 0 | 21| NDB_API_SCAN_BATCH_COUNT | 0 | 22| NDB_API_READ_ROW_COUNT | 2 | 23| NDB_API_TRANS_LOCAL_READ_ROW_COUNT | 2 | 24| NDB_API_EVENT_DATA_COUNT | 0 | 25| NDB_API_EVENT_NONDATA_COUNT | 0 | 26| NDB_API_EVENT_BYTES_COUNT | 0 | 27+------------------------------------+----------------+ 2821 rows in set (0.09 sec)
모든 카운터가 네 개의 상태 변수 집합 모두에 반영되는 것은 아닙니다. 이벤트 카운터 DataEventsRecvdCount, NondataEventsRecvdCount, EventBytesRecvdCount의 경우, _injector와 mysqld-레벨 NDB API 상태 변수만 사용할 수 있습니다:
1mysql> SHOW STATUS LIKE 'ndb_api%event%'; 2+--------------------------------------+-------+ 3| Variable_name | Value | 4+--------------------------------------+-------+ 5| Ndb_api_event_data_count_injector | 0 | 6| Ndb_api_event_nondata_count_injector | 0 | 7| Ndb_api_event_bytes_count_injector | 0 | 8| Ndb_api_event_data_count | 0 | 9| Ndb_api_event_nondata_count | 0 | 10| Ndb_api_event_bytes_count | 0 | 11+--------------------------------------+-------+ 126 rows in set (0.00 sec)
_injector 상태 변수은 다음과 같이 다른 어떤 NDB API 카운터에 대해서도 구현되어 있지 않습니다:
1mysql> SHOW STATUS LIKE 'ndb_api%injector%'; 2+--------------------------------------+-------+ 3| Variable_name | Value | 4+--------------------------------------+-------+ 5| Ndb_api_event_data_count_injector | 0 | 6| Ndb_api_event_nondata_count_injector | 0 | 7| Ndb_api_event_bytes_count_injector | 0 | 8+--------------------------------------+-------+ 93 rows in set (0.00 sec)
상태 변수의 이름은 해당 카운터 이름과 쉽게 연관 지을 수 있습니다. 각 NDB API 통계 카운터는 설명과 함께, 이 카운터에 해당하는 MySQL 서버 상태 변수의 이름과 함께 다음 테이블에 나열되어 있습니다.
Table 25.39 NDB API statistics counter
| Counter Name | Description | Status Variables (by statistic type):<br>- Session<br> <br> <br>- Replica (slave)<br> <br> <br>- Injector<br> <br> <br>- Server |
|---|---|---|
WaitExecCompleteCount | 작업 실행이 완료되기를 기다리는 동안 스레드가 블록된 횟수. 여기에는 blob 작업에 대한 암시적 execute 및 클라이언트에 보이지 않는 자동 증가뿐만 아니라 모든 execute() 호출이 포함됩니다. | - Ndb_api_wait_exec_complete_count_session<br> <br>- Ndb_api_wait_exec_complete_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_wait_exec_complete_count |
WaitScanResultCount | 스캔 기반 시그널(추가 결과를 기다리거나 스캔이 종료되기를 기다리는 등)을 기다리는 동안 스레드가 블록된 횟수. | - Ndb_api_wait_scan_result_count_session<br> <br>- Ndb_api_wait_scan_result_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_wait_scan_result_count |
WaitMetaRequestCount | 메타데이터 기반 시그널을 기다리면서 스레드가 블록된 횟수. 이는 DDL 작업을 기다리거나 에폭이 시작(또는 종료)되기를 기다릴 때 발생할 수 있습니다. | - Ndb_api_wait_meta_request_count_session<br> <br>- Ndb_api_wait_meta_request_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_wait_meta_request_count |
WaitNanosCount | 데이터 노드로부터 어떤 유형의 시그널을 기다리는 데 소비된 총 시간(나노초 단위). | - Ndb_api_wait_nanos_count_session<br> <br>- Ndb_api_wait_nanos_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_wait_nanos_count |
BytesSentCount | 데이터 노드로 전송된 데이터의 양(바이트 단위). | - Ndb_api_bytes_sent_count_session<br> <br>- Ndb_api_bytes_sent_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_bytes_sent_count |
BytesRecvdCount | 데이터 노드로부터 수신된 데이터의 양(바이트 단위). | - Ndb_api_bytes_received_count_session<br> <br>- Ndb_api_bytes_received_count_slave<br> <br>- [none]<br> <br> <br>- Ndb_api_bytes_received_count |
TransStartCount | 시작된 트랜잭션의 수. | - Ndb_api_trans_start_count_session<br> <br>- Ndb_api_trans_start_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_trans_start_count |
TransCommitCount | 커밋된 트랜잭션의 수. | - Ndb_api_trans_commit_count_session<br> <br>- Ndb_api_trans_commit_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_trans_commit_count |
TransAbortCount | 중단된(abort된) 트랜잭션의 수. | - Ndb_api_trans_abort_count_session<br> <br>- Ndb_api_trans_abort_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_trans_abort_count |
TransCloseCount | 종료된(닫힌) 트랜잭션의 수. (이 값은 TransCommitCount와 TransAbortCount의 합보다 클 수 있습니다.) | - Ndb_api_trans_close_count_session<br> <br>- Ndb_api_trans_close_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_trans_close_count |
PkOpCount | 프라이머리 키를 기반으로 하거나 사용하는 오퍼레이션의 수. 이 카운트에는 blob-part 테이블 오퍼레이션, 암시적 unlock 오퍼레이션, 자동 증가 오퍼레이션뿐 아니라 MySQL 클라이언트에 일반적으로 보이는 프라이머리 키 오퍼레이션이 포함됩니다. | - Ndb_api_pk_op_count_session<br> <br>- Ndb_api_pk_op_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_pk_op_count |
UkOpCount | 유니크 키를 기반으로 하거나 사용하는 오퍼레이션의 수. | - Ndb_api_uk_op_count_session<br> <br>- Ndb_api_uk_op_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_uk_op_count |
TableScanCount | 시작된 테이블 스캔의 수. 내부 테이블의 스캔도 포함됩니다. | - Ndb_api_table_scan_count_session<br> <br>- Ndb_api_table_scan_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_table_scan_count |
RangeScanCount | 시작된 범위 스캔의 수. | - Ndb_api_range_scan_count_session<br> <br>- Ndb_api_range_scan_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_range_scan_count |
PrunedScanCount | 하나의 파티션으로 프루닝된 스캔의 수. | - Ndb_api_pruned_scan_count_session<br> <br>- Ndb_api_pruned_scan_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_pruned_scan_count |
ScanBatchCount | 수신된 로우 배치의 수. (이 컨텍스트에서 배치는 단일 프래그먼트에서 나온 스캔 결과 집합입니다.) | - Ndb_api_scan_batch_count_session<br> <br>- Ndb_api_scan_batch_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_scan_batch_count |
ReadRowCount | 읽힌 로우의 총 수. 여기에는 프라이머리 키, 유니크 키, 스캔 오퍼레이션을 사용하여 읽힌 로우가 모두 포함됩니다. | - Ndb_api_read_row_count_session<br> <br>- Ndb_api_read_row_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_read_row_count |
TransLocalReadRowCount | 트랜잭션이 실행 중인 동일한 데이터 노드에서 읽힌 로우 수. | - Ndb_api_trans_local_read_row_count_session<br> <br>- Ndb_api_trans_local_read_row_count_replica<br> <br>- [none]<br> <br> <br>- Ndb_api_trans_local_read_row_count |
DataEventsRecvdCount | 수신된 로우 변경 이벤트 수. | - [none]<br> <br> <br>- [none]<br> <br> <br>- Ndb_api_event_data_count_injector<br> <br>- Ndb_api_event_data_count |
NondataEventsRecvdCount | 로우 변경 이벤트 이외에 수신된 이벤트 수. | - [none]<br> <br> <br>- [none]<br> <br> <br>- Ndb_api_event_nondata_count_injector<br> <br>- Ndb_api_event_nondata_count |
EventBytesRecvdCount | 수신된 이벤트 바이트 수. | - [none]<br> <br> <br>- [none]<br> <br> <br>- Ndb_api_event_bytes_count_injector<br> <br>- Ndb_api_event_bytes_count |
| Counter Name | Description | Status Variables (by statistic type):<br>- Session<br> <br> <br>- Replica (slave)<br> <br> <br>- Injector<br> <br> <br>- Server |
|---|
커밋된 트랜잭션의 모든 카운트, 즉 모든 TransCommitCount 카운터 상태 변수를 확인하려면, 다음과 같이 SHOW STATUS 결과를 서브스트링 trans_commit_count로 필터하면 됩니다:
1mysql> SHOW STATUS LIKE '%trans_commit_count%'; 2+------------------------------------+-------+ 3| Variable_name | Value | 4+------------------------------------+-------+ 5| Ndb_api_trans_commit_count_session | 1 | 6| Ndb_api_trans_commit_count_slave | 0 | 7| Ndb_api_trans_commit_count | 2 | 8+------------------------------------+-------+ 93 rows in set (0.00 sec)
이를 통해 현재 mysql 클라이언트 세션에서 1개의 트랜잭션이 커밋되었고, 이 mysqld가 마지막으로 재시작된 이후 총 2개의 트랜잭션이 커밋되었음을 알 수 있습니다.
주어진 SQL 문장에 의해 다양한 NDB API 카운터가 어떻게 증가하는지 확인하려면, 해당 문장을 수행하기 직전과 직후의 _session 상태 변수 값을 비교하면 됩니다. 이 예제에서, SHOW\ STATUS에서 초기 값을 얻은 후 test 데이터베이스에 단일 컬럼을 가진 t라는 이름의 NDB 테이블을 생성합니다:
1mysql> SHOW STATUS LIKE 'ndb_api%session%'; 2+--------------------------------------------+--------+ 3| Variable_name | Value | 4+--------------------------------------------+--------+ 5| Ndb_api_wait_exec_complete_count_session | 2 | 6| Ndb_api_wait_scan_result_count_session | 0 | 7| Ndb_api_wait_meta_request_count_session | 3 | 8| Ndb_api_wait_nanos_count_session | 820705 | 9| Ndb_api_bytes_sent_count_session | 132 | 10| Ndb_api_bytes_received_count_session | 372 | 11| Ndb_api_trans_start_count_session | 1 | 12| Ndb_api_trans_commit_count_session | 1 | 13| Ndb_api_trans_abort_count_session | 0 | 14| Ndb_api_trans_close_count_session | 1 | 15| Ndb_api_pk_op_count_session | 1 | 16| Ndb_api_uk_op_count_session | 0 | 17| Ndb_api_table_scan_count_session | 0 | 18| Ndb_api_range_scan_count_session | 0 | 19| Ndb_api_pruned_scan_count_session | 0 | 20| Ndb_api_scan_batch_count_session | 0 | 21| Ndb_api_read_row_count_session | 1 | 22| Ndb_api_trans_local_read_row_count_session | 1 | 23+--------------------------------------------+--------+ 2418 rows in set (0.00 sec) 25 26mysql> USE test; 27Database changed 28mysql> CREATE TABLE t (c INT) ENGINE NDBCLUSTER; 29Query OK, 0 rows affected (0.85 sec)
이제 새로운 SHOW\ STATUS 문장을 실행하고 다음과 같이 변경 사항을 관찰할 수 있습니다(output에서 변경된 로우가 강조 표시되어 있다고 가정):
1mysql> SHOW STATUS LIKE 'ndb_api%session%'; 2+--------------------------------------------+-----------+ 3| Variable_name | Value | 4+--------------------------------------------+-----------+ 5| Ndb_api_wait_exec_complete_count_session | 8 | 6| Ndb_api_wait_scan_result_count_session | 0 | 7| Ndb_api_wait_meta_request_count_session | 17 | 8| Ndb_api_wait_nanos_count_session | 706871709 | 9| Ndb_api_bytes_sent_count_session | 2376 | 10| Ndb_api_bytes_received_count_session | 3844 | 11| Ndb_api_trans_start_count_session | 4 | 12| Ndb_api_trans_commit_count_session | 4 | 13| Ndb_api_trans_abort_count_session | 0 | 14| Ndb_api_trans_close_count_session | 4 | 15| Ndb_api_pk_op_count_session | 6 | 16| Ndb_api_uk_op_count_session | 0 | 17| Ndb_api_table_scan_count_session | 0 | 18| Ndb_api_range_scan_count_session | 0 | 19| Ndb_api_pruned_scan_count_session | 0 | 20| Ndb_api_scan_batch_count_session | 0 | 21| Ndb_api_read_row_count_session | 2 | 22| Ndb_api_trans_local_read_row_count_session | 1 | 23+--------------------------------------------+-----------+ 2418 rows in set (0.00 sec)
마찬가지로, t에 로우를 insert함으로써 발생하는 NDB API 통계 카운터의 변화를 볼 수 있습니다. 로우를 insert한 다음, 이전 예제에서 사용한 것과 동일한 SHOW\ STATUS 문장을 다음과 같이 실행합니다:
1mysql> INSERT INTO t VALUES (100); 2Query OK, 1 row affected (0.00 sec) 3 4mysql> SHOW STATUS LIKE 'ndb_api%session%'; 5+--------------------------------------------+-----------+ 6| Variable_name | Value | 7+--------------------------------------------+-----------+ 8| Ndb_api_wait_exec_complete_count_session | 11 | 9| Ndb_api_wait_scan_result_count_session | 6 | 10| Ndb_api_wait_meta_request_count_session | 20 | 11| Ndb_api_wait_nanos_count_session | 707370418 | 12| Ndb_api_bytes_sent_count_session | 2724 | 13| Ndb_api_bytes_received_count_session | 4116 | 14| Ndb_api_trans_start_count_session | 7 | 15| Ndb_api_trans_commit_count_session | 6 | 16| Ndb_api_trans_abort_count_session | 0 | 17| Ndb_api_trans_close_count_session | 7 | 18| Ndb_api_pk_op_count_session | 8 | 19| Ndb_api_uk_op_count_session | 0 | 20| Ndb_api_table_scan_count_session | 1 | 21| Ndb_api_range_scan_count_session | 0 | 22| Ndb_api_pruned_scan_count_session | 0 | 23| Ndb_api_scan_batch_count_session | 0 | 24| Ndb_api_read_row_count_session | 3 | 25| Ndb_api_trans_local_read_row_count_session | 2 | 26+--------------------------------------------+-----------+ 2718 rows in set (0.00 sec)
이 결과로부터 다음과 같은 여러 가지 관찰을 할 수 있습니다:
t를 명시적인 프라이머리 키 없이 생성했음에도, 이 작업을 수행하는 동안 5개의 프라이머리 키 오퍼레이션이 실행되었습니다(“이전”과 “이후” 값의 차이는 Ndb_api_pk_op_count_session에서 6에서 1을 뺀 값). 이는 NDB 스토리지 엔진을 사용하는 모든 테이블의 기능인 히든 프라이머리 키의 생성을 반영합니다.
Ndb_api_wait_nanos_count_session의 연속된 값을 비교해 보면, CREATE TABLE 문장을 구현하는 NDB API 오퍼레이션이 데이터 노드로부터 응답을 기다리는 데 ([706871709 - 820705 = 706051004] 나노초, 즉 약 0.7초) INSERT가 실행한 오퍼레이션보다 훨씬 더 오래 기다렸음을 알 수 있습니다(707370418 - 706871709 = 498709 ns, 대략 0.0005초). mysql 클라이언트에서 이들 문장에 대해 보고되는 실행 시간은 이러한 수치와 대략적으로 상관관계가 있습니다.
플랫폼에 나노초 단위의 충분한 시간 해상도가 없는 경우, 매우 빠르게 실행되는 SQL 문장 때문에 WaitNanosCount NDB API 카운터 값에 발생하는 작은 변화는 Ndb_api_wait_nanos_count_session, Ndb_api_wait_nanos_count_replica, 또는 Ndb_api_wait_nanos_count 값에서 항상 보이지는 않을 수 있습니다.
INSERT 문장은 ReadRowCount 및 TransLocalReadRowCount NDB API 통계 카운터를 모두 증가시켰으며, 이는 Ndb_api_read_row_count_session 및 Ndb_api_trans_local_read_row_count_session의 값 증가로 반영됩니다.25.6.13 Privilege Synchronization and NDB_STORED_USER
25.6.15 ndbinfo: The NDB Cluster Information Database