[MySQL] Performance Schema 상태 모니터링

■ performance schema 상태 모니터링.

다음과 같은 쿼리로 performance schema 상태를 확인할 있습니다.

mysql> SHOW STATUS LIKE 'perf%';
+-----------------------------------------------+-------+
| Variable_name                                 | Value |
+-----------------------------------------------+-------+
| Performance_schema_accounts_lost              | 0     |
| Performance_schema_cond_classes_lost          | 0     |
| Performance_schema_cond_instances_lost        | 0     |
| Performance_schema_digest_lost                | 0     |
| Performance_schema_file_classes_lost          | 0     |
| Performance_schema_file_handles_lost          | 0     |
| Performance_schema_file_instances_lost        | 0     |
| Performance_schema_hosts_lost                 | 0     |
| Performance_schema_locker_lost                | 0     |
| Performance_schema_memory_classes_lost        | 0     |
| Performance_schema_metadata_lock_lost         | 0     |
| Performance_schema_mutex_classes_lost         | 0     |
| Performance_schema_mutex_instances_lost       | 0     |
| Performance_schema_nested_statement_lost      | 0     |
| Performance_schema_program_lost               | 0     |
| Performance_schema_rwlock_classes_lost        | 0     |
| Performance_schema_rwlock_instances_lost      | 0     |
| Performance_schema_session_connect_attrs_lost | 0     |
| Performance_schema_socket_classes_lost        | 0     |
| Performance_schema_socket_instances_lost      | 0     |
| Performance_schema_stage_classes_lost         | 0     |
| Performance_schema_statement_classes_lost     | 0     |
| Performance_schema_table_handles_lost         | 0     |
| Performance_schema_table_instances_lost       | 0     |
| Performance_schema_thread_classes_lost        | 0     |
| Performance_schema_thread_instances_lost      | 0     |
| Performance_schema_users_lost                 | 0     |
+-----------------------------------------------+-------+

 

성능 스키마 상태 변수는 메모리 제약으로 인해 로드하거나 만들 수 없는 계측에 대한 정보를 제공합니다. 이러한 변수의 이름에는 여러 가지 형식이 있습니다.

+ Performance_schema_xxx_classes_lost xxx 유형의 계측기를로드 수없는 수를 나타냅니다.

+ Performance_schema_xxx_instances_lost 생성 수없는 객체 유형 xxx 인스턴스 수를 나타냅니다.

+ Performance_schema_xxx_handles_lost xxx 개체 유형의 인스턴스를 수없는 수를 나타냅니다.

+ Performance_schema_locker_lost "손실"되었거나 기록되지 않은 이벤트 수를 나타냅니다.

 

예를 들어 뮤텍스가 서버 소스에서 계측되지만 서버가 런타임에 계측을 위한 메모리를 할당할 수 없는 경우 Performance_schema_mutex_classes_lost 증가합니다. 뮤텍스는 여전히 동기화 개체로 작동하지만 (, 서버가 계속 정상적으로 작동 ) 이에 대한 성능 데이터는 수집되지 않습니다. 계측기를 할당 수있는 경우 계측 뮤텍스 인스턴스를 초기화하는 사용할 있습니다. 글로벌 뮤텍스와 같은 싱글 뮤텍스의 경우 인스턴스가 하나만 있습니다. 다른 뮤텍스는 연결 또는 다양한 캐시 데이터 버퍼의 페이지 인스턴스를 가지므로 인스턴스 수는 시간에 따라 달라집니다. 최대 연결 또는 일부 버퍼의 최대 크기를 늘리면 번에 할당 수있는 최대 인스턴스 수가 증가합니다. 서버가 주어진 계측 뮤텍스 인스턴스를 만들 수없는 경우 Performance_schema_mutex_instances_lost 증가시킵니다.

 

performance schema 관련된 시스템 변수가 실행될 계측기마다 할당되는 최대 기본 값들이 있습니다. 파라미터들은 xxx_max_xxx_instance, xxx_max_xxx_class등으로 되어 있습니다.

서버 운영중 서버가 런타임에 계측을 위한 메모리를 할당할 없는 경우 해당되는 Performance_schema_xxx_lost value컬럼 값이 증가합니다.

또한 서버가 주어진 계측기를 만들 없는 경우 해당되는 xxx_lost value컬럼 값이 증가합니다.

계측기는 여전히 동기화 개체로 작동하지만 (, 서버가 계속 정상적으로 작동 ) 이에 대한 성능 데이터는 수집되지 않습니다.

 

performance schema 파라미터에 할당된 계측기 관련 변수들의 기본값은 MySQL에서 사용되는 모든 계측기를 사용하는데 충분한 값입니다.

만약 위의 특정 값들이 증가한다면 관련 파라미터의 값을 증가해야 합니다. 그리고 그만큼 메모리 사용량이 커지게 됩니다. 그래서 메모리 증설이 필요할 수도 있고 메모리가 충분하지 않다면

다른 파라미터들의 값을 내려야 합니다.

 

위의 상태 변수에서 값이 증가하더라도 에러 메세지에는 나타나지 않습니다. 위의 상태값 증가가 performance schema 계측에 문제가 있다는 것을 나타내는 유일한 표시입니다.

 

다음 명령어를 이용하면 performance_schema 상태를 자세하게 확인할 있습니다.

특히 마지막에 메모리를 얼마나 사용하는지 확인이 가능합니다.

mysql> show engine performance_schema status;
+--------------------+-------------------------------------------------------------+-----------+
| Type               | Name                                                        | Status    |
+--------------------+-------------------------------------------------------------+-----------+
| performance_schema | events_waits_current.size                                   | 176       |
| performance_schema | events_waits_current.count                                  | 1536      |
| performance_schema | events_waits_history.size                                   | 176       |
| performance_schema | events_waits_history.count                                  | 2560      |
| performance_schema | events_waits_history.memory                                 | 450560    |
| performance_schema | events_waits_history_long.size                              | 176       |
| performance_schema | events_waits_history_long.count                             | 10000     |
| performance_schema | events_waits_history_long.memory                            | 1760000   |
| performance_schema | (pfs_mutex_class).size                                      | 256       |
| performance_schema | (pfs_mutex_class).count                                     | 210       |
| performance_schema | (pfs_mutex_class).memory                                    | 53760     |
| performance_schema | (pfs_rwlock_class).size                                     | 256       |
| performance_schema | (pfs_rwlock_class).count                                    | 50        |
......
| performance_schema | (current_statements_text_array).size                        | 1024      |
| performance_schema | (current_statements_text_array).memory                      | 2621440   |
| performance_schema | (statements_digest_token_array).count                       | 10000     |
| performance_schema | (statements_digest_token_array).size                        | 1024      |
| performance_schema | (statements_digest_token_array).memory                      | 10240000  |
| performance_schema | performance_schema.memory                                   | 138098872 |
+--------------------+-------------------------------------------------------------+-----------+

 

■ Performance Schema 상태 변수

+ Performance_schema_accounts_lost

행이 가득 차서 accounts 테이블에 추가할 수 없는 횟수입니다.

 

+ Performance_schema_cond_classes_lost

로드할 수 없는 조건 기기의 수입니다.

 

+ Performance_schema_cond_instances_lost

생성할 수 없는 조건 기기 인스턴스 수입니다.

 

+ Performance_schema_digest_lost

events_statements_summary_by_digest 테이블에서 계측할 수 없는 다이제스트 인스턴스의 수입니다. performance_schema_digests_size 값이 너무 작은 경우 0 아닐 있습니다.

 

+ Performance_schema_file_classes_lost

로드할 수 없는 파일 도구 수입니다.

 

+ Performance_schema_file_handles_lost

수 없는 파일 계측기 인스턴스 수입니다.

 

+ Performance_schema_file_instances_lost

생성할 수 없는 파일 계측기 인스턴스 수입니다.

 

+ Performance_schema_hosts_lost

행이 가득 차서 호스트 테이블에 추가할 수 없는 횟수입니다.

 

+ Performance_schema_index_stat_lost

통계가 손실된 인덱스 수입니다. performance_schema_max_index_stat 값이 너무 작으면 0 아닐 있습니다.

 

+ Performance_schema_locker_lost

다음 조건으로 인해 "손실"되거나 기록되지 않은 이벤트 :

- 이벤트는 재귀적입니다 (예를 들어, A 기다리면 B에서 대기하여 C에서 대기).

- 중첩된 이벤트 스택의 깊이가 구현에서 지정한 제한보다 큽니다.

 

성능 스키마에 의해 기록 이벤트는 재귀 적이 않으므로이 변수는 항상 0이어야합니다.

 

+ Performance_schema_memory_classes_lost

메모리 기기를 로드할 수 없는 횟수입니다.

 

+ Performance_schema_metadata_lock_lost

metadata_locks 테이블에서 계측할 수 없는 메타 데이터 잠금 수입니다. performance_schema_max_metadata_locks 값이 너무 작으면 0 아닐 있습니다.

 

+ Performance_schema_mutex_classes_lost

로드할 수 없는 뮤텍스 기기 수입니다.

 

+ Performance_schema_mutex_instances_lost

생성할 수 없는 뮤텍스 계측기 인스턴스 수입니다.

 

+ Performance_schema_nested_statement_lost

통계가 손실된 저장된 프로그램 명령문의 수입니다. performance_schema_max_statement_stack 값이 너무 작으면 0 아닐 있습니다.

 

+ Performance_schema_prepared_statements_lost

ready_statements_instances 테이블에서 계측 수없는 준비된 명령문의 수입니다. performance_schema_max_prepared_statements_instances 값이 너무 으면 0 아닐 있습니다.

 

+ Performance_schema_program_lost

통계가 손실된 저장 프로그램의 수 입니다. performance_schema_max_program_instances 값이 너무 작으면 0 아닐 있습니다.

 

+ Performance_schema_rwlock_classes_lost

로드할 수 없는 rwlock 기기 수입니다.

 

+ Performance_schema_rwlock_instances_lost

생성할 수 없는 rwlock 계측기 인스턴스 수입니다.

 

+ Performance_schema_session_connect_attrs_lost

연결 속성 잘림이 발생한 연결 수입니다. 지정된 연결에 대해 클라이언트가 집계 크기가 performance_schema_session_connect_attrs_size 시스템 변수의 값에서 허용하는 예약된 저장소보다 연결 속성 - 쌍을 전송하면 성능 스키마는 속성 데이터를 자르고 Performance_schema_session_connect_attrs_lost 증가시킵니다. 값이 0 아닌 경우 performance_schema_session_connect_attrs_size 값으로 설정할 있습니다.

 

+ Performance_schema_socket_classes_lost

로드할 수 없는 소켓 기기 수입니다.

 

+ Performance_schema_socket_instances_lost

생성할 수 없는 소켓 계측기 인스턴스 수입니다.

 

+ Performance_schema_stage_classes_lost

개의 무대 악기를 로드할 없습니다.

 

+ Performance_schema_statement_classes_lost

로드할 수 없는 명령문 도구수 입니다.

 

+ Performance_schema_table_handles_lost

수 없는 테이블 기기 인스턴스 수입니다. performance_schema_max_table_handles 값이 너무 작으면 0 아닐 있습니다.

 

+ Performance_schema_table_instances_lost

생성할 수 없는 테이블 기기 인스턴스 수입니다.

 

+ Performance_schema_table_lock_stat_lost

잠금 통계가 손실된 테이블 수입니다. performance_schema_max_table_lock_stat 값이 너무 작으면 0 아닐 있습니다.

 

+ Performance_schema_thread_classes_lost

로드할 수 없는 스레드 기기 수입니다.

 

+ Performance_schema_thread_instances_lost

threads 테이블에서 계측할 수 없는 스레드 인스턴스 수입니다. performance_schema_max_thread_instances 값이 너무 작으면 0 아닐 있습니다.

 

+ Performance_schema_users_lost

행이 가득 차서 사용자 테이블에 추가할 수 없는 횟수입니다.

 

 

▣ Performance Schema 목차.

[MySQL] Performance Schema 소개 및 사용방법

 

[MySQL] Performance Schema 소개 및 사용방법

■ Performance Schema 소개 MySQL 성능 스키마는 낮은 수준에서 MySQL 서버 실행을 모니터링하는 기능입니다. 성능 스키마에는 다음과 같은 특성이 있습니다. - 성능 스키마는 런타임에 서버의 내부 실

myinfrabox.tistory.com

[MySQL] Performance Schema 상태 모니터링

 

[MySQL] Performance Schema 상태 모니터링

■ performance schema 상태 모니터링. 다음과 같은 쿼리로 performance schema의 상태를 확인할 수 있습니다. mysql> SHOW STATUS LIKE 'perf%'; +-----------------------------------------------+-------+ | V..

myinfrabox.tistory.com

[MySQL] Performance Schema 설정 테이블 - Setup 및 Instance 테이블

 

[MySQL] Performance Schema 설정 테이블 - Setup 및 Instance 테이블

■ Setup Tables setup_actors : 새로운 포그라운드 스레드(foreground threads : 접속 클라이언트 혹은 서버)에 대한 모니터링을 초기화하는 방법 setup_consumers : 이벤트 정보를 보내고 저장할 수 있는 대상 s..

myinfrabox.tistory.com

[MySQL] Performance Schema 모니터링 테이블 - Wait Event 및 Lock 테이블

 

[MySQL] Performance Schema 모니터링 테이블 - Wait Event 및 Lock 테이블

■ Wait Event 테이블 종류 성능 스키마 도구는 시간이 걸리는 이벤트를 대기합니다. 이벤트 계층 구조 내에서 대기 이벤트는 트랜잭션 이벤트 내에 중첩되는 명령문 이벤트 내에 중첩되는 스테이

myinfrabox.tistory.com

[MySQL] Performance Schema 모니터링 테이블 - Stage Event 테이블

 

[MySQL] Performance Schema 모니터링 테이블 - Stage Event 테이블

■ Stage Event 테이블 성능 스키마 단계는 명령문 구문 분석, 테이블 열기 또는 파일 정렬 작업 수행과 같은 명령 실행 프로세스 중 단계입니다. 스테이지는 SHOW PROCESSLIST에 의해 표시되거나 INFORMATI

myinfrabox.tistory.com

 

[MySQL] Performance Schema 모니터링 테이블 - Statement Event 테이블

 

[MySQL] Performance Schema 모니터링 테이블 - Statement Event 테이블

■ Statement Event 테이블 성능 스키마 도구 명령문 실행. 명령문 이벤트는 이벤트 계층 구조의 높은 수준에서 발생합니다. 이벤트 계층 구조 내에서 대기 이벤트는 트랜잭션 이벤트 내에 중첩되는

myinfrabox.tistory.com

[MySQL] Performance Schema 모니터링 테이블 - Transaction 테이블

 

[MySQL] Performance Schema 모니터링 테이블 - Transaction 테이블

■ Transaction 테이블 성능 스키마는 트랜잭션을 계측합니다. 이벤트 계층 구조 내에서 대기 이벤트는 트랜잭션 이벤트 내에 중첩되는 명령문 이벤트 내에 중첩되는 스테이지 이벤트 내에 중첩됩

myinfrabox.tistory.com

[MySQL] Performance Schema 모니터링 테이블 - Connection 및 Connection Attribute 테이블

 

[MySQL] Performance Schema 모니터링 테이블 - Connection 및 Connection Attribute 테이블

■ Connection 테이블 클라이언트가 MySQL 서버에 연결하면 특정 사용자 이름과 특정 호스트에서 연결됩니다. 성능 스키마는 이러한 연결에 대한 통계를 제공하고 다음 표를 사용하여 계정 (사용자

myinfrabox.tistory.com

[MySQL] Performance Schema 모니터링 테이블 - User, 시스템, 상태 및 기타 테이블

 

[MySQL] Performance Schema 모니터링 테이블 - User, 시스템, 상태 및 기타 테이블

■ User-Defined Variable 테이블 성능 스키마는 사용자 정의 변수를 노출하는 user_variables_by_thread 테이블을 제공합니다. 이들은 특정 세션 내에서 정의된 변수이며 이름 앞에 @문자를 포함합니다. user_v

myinfrabox.tistory.com

[MySQL] Performance Schema 모니터링 테이블 - Summary(요약) 테이블

 

[MySQL] Performance Schema 모니터링 테이블 - Summary(요약) 테이블

■ Summary(요약) 테이블 ▶︎ objects_summary_global_by_type 테이블 성능 스키마는 개체 대기 이벤트를 집계하기 위해 objects_summary_global_by_type 테이블을 유지합니다. 예제 개체 대기 이벤트 요약 정보..

myinfrabox.tistory.com

[MySQL] Performance Schema 모니터링 테이블 - Replication 테이블

 

[MySQL] Performance Schema 모니터링 테이블 - Replication 테이블

■ Replication 테이블 성능 스키마는 복제 정보를 노출하는 테이블을 제공합니다. 이는 SHOW SLAVE STATUS 문에서 사용할 수있는 정보와 비슷하지만 테이블 형식으로 표현하는 것이 더 접근하기 쉽고

myinfrabox.tistory.com

 

Designed by JB FACTORY