Loading...
MySQL 9.5 Reference Manual 9.5의 29.17 The Performance Schema Memory-Allocation Model의 한국어 번역본입니다.
아래의 경우에 피드백에서 신고해주신다면 반영하겠습니다.
감사합니다 :)
Performance Schema는 다음과 같은 메모리 할당 모델을 사용합니다:
서버 startup 시 메모리를 할당할 수 있음
서버 operation 중에 추가 메모리를 할당할 수 있음
서버 operation 중에는 메모리를 절대 free 하지 않음 (재사용될 수는 있음)
shutdown 시 사용한 모든 메모리를 free 함
이 결과로 메모리 제약을 완화하여 Performance Schema를 더 적은 구성으로 사용할 수 있고, 메모리 풋프린트를 줄여서 소비량이 서버 부하에 따라 확장되도록 합니다. 사용되는 메모리는 추정되거나 명시적으로 설정된 부하가 아니라, 실제로 관측된 부하에 따라 달라집니다.
여러 Performance Schema sizing parameter는 자동으로 스케일링되며, 메모리 할당에 대한 명시적인 한도를 설정하고자 하는 경우가 아니라면 명시적으로 구성할 필요가 없습니다:
1performance_schema_accounts_size 2performance_schema_hosts_size 3performance_schema_max_cond_instances 4performance_schema_max_file_instances 5performance_schema_max_index_stat 6performance_schema_max_metadata_locks 7performance_schema_max_mutex_instances 8performance_schema_max_prepared_statements_instances 9performance_schema_max_program_instances 10performance_schema_max_rwlock_instances 11performance_schema_max_socket_instances 12performance_schema_max_table_handles 13performance_schema_max_table_instances 14performance_schema_max_table_lock_stat 15performance_schema_max_thread_instances 16performance_schema_users_size
오토스케일되는 parameter의 경우, 구성은 다음과 같이 동작합니다:
값이 -1(기본값)로 설정된 경우, parameter는 오토스케일됩니다:
해당 internal 버퍼는 초기에는 비어 있으며 메모리가 할당되지 않습니다.
Performance Schema가 데이터를 수집함에 따라 해당 버퍼에 메모리가 할당됩니다. 버퍼 크기에는 제한이 없으며 부하에 따라 증가할 수 있습니다.
값이 0으로 설정된 경우:
값이 N > 0으로 설정된 경우:
해당 internal 버퍼는 초기에는 비어 있으며 메모리가 할당되지 않습니다.
Performance Schema가 데이터를 수집함에 따라 해당 버퍼에 메모리가 할당되며, 버퍼 크기가 N 에 도달할 때까지 계속됩니다.
버퍼 크기가 N 에 도달하면, 더 이상 메모리가 할당되지 않습니다. 이 버퍼에 대해 Performance Schema가 수집하는 데이터는 손실되며, 관련 “lost instance” 카운터가 증가합니다.
Performance Schema가 얼마나 많은 메모리를 사용 중인지 확인하려면, 그 목적을 위해 설계된 instrument를 확인하면 됩니다. Performance Schema는 내부적으로 메모리를 할당하고 각 버퍼를 전용 instrument와 연결하여, 메모리 사용량을 개별 버퍼에 추적할 수 있도록 합니다. memory/performance_schema/ prefix로 이름이 지정된 instrument는 이러한 internal 버퍼에 얼마나 많은 메모리가 할당되었는지를 노출합니다. 버퍼는 서버에 대해 글로벌하기 때문에, 해당 instrument는 memory_summary_global_by_event_name 테이블에만 표시되고, 다른 memory_summary_by_xxx_by_event_name 테이블에는 표시되지 않습니다.
다음 query는 메모리 instrument와 관련된 정보를 보여줍니다:
1SELECT * FROM performance_schema.memory_summary_global_by_event_name 2WHERE EVENT_NAME LIKE 'memory/performance_schema/%';
29.16 Performance Schema Status Variables
29.18 Performance Schema and Plugins