Loading...
MySQL 9.5 Reference Manual 9.5의 29.12.9 Performance Schema Connection Attribute Tables의 한국어 번역본입니다.
아래의 경우에 피드백에서 신고해주신다면 반영하겠습니다.
감사합니다 :)
29.12.9.1 The session_account_connect_attrs Table 29.12.9.2 The session_connect_attrs Table
Connection attribute는 애플리케이션 프로그램이 접속 시점에 서버로 전달할 수 있는 key-value pair입니다. libmysqlclient 클라이언트 라이브러리로 구현된 C API 기반 애플리케이션의 경우, mysql_options() 및 mysql_options4() function이 connection attribute 집합을 정의합니다. 다른 MySQL Connector들은 자체적인 attribute 정의 메서드를 제공할 수 있습니다.
다음 Performance Schema 테이블들은 attribute 정보를 노출합니다:
session_account_connect_attrs:
현재 세션과, 세션 계정과 연관된 다른 세션에 대한 connection attribute
session_connect_attrs:
모든 세션에 대한 connection attribute
추가로, audit log에 기록되는 connect 이벤트에는 connection attribute가 포함될 수 있습니다. Section 8.4.6.4, “Audit Log File Formats”를 참조하십시오.
이름이 언더스코어(_)로 시작하는 attribute는 내부용으로 예약되어 있으므로 애플리케이션 프로그램에서 생성해서는 안 됩니다. 이 규칙은 MySQL이 애플리케이션 attribute와 충돌하지 않고 새로운 attribute를 도입할 수 있게 해 주며, 애플리케이션 프로그램이 내부 attribute와 충돌하지 않는 자체 attribute를 정의할 수 있게 해 줍니다.
주어진 connection 내에서 볼 수 있는 connection attribute 집합은 플랫폼, connection을 설정하는 데 사용된 MySQL Connector, 클라이언트 프로그램 등의 요소에 따라 달라집니다.
libmysqlclient 클라이언트 라이브러리는 다음 attribute를 설정합니다:
_client_name: 클라이언트 이름
(libmysql은 클라이언트 라이브러리의 경우).
_client_version: 클라이언트 라이브러리 버전.
_os: 운영체제(예:
Linux, Win64).
_pid: 클라이언트 프로세스 ID.
_platform: 머신 플랫폼(예:
x86_64).
_thread: 클라이언트 스레드 ID(Windows 전용).
다른 MySQL Connector들은 자체적인 connection attribute를 정의할 수 있습니다.
MySQL Connector/C++는 X DevAPI 또는 X DevAPI for C를 사용하는 애플리케이션에 대해 다음 attribute를 정의합니다:
_client_license: connector 라이선스
(예: GPL-2.0).
_client_name: connector 이름
(mysql-connector-cpp).
_client_version: connector 버전.
_os: 운영체제(예:
Linux, Win64).
_pid: 클라이언트 프로세스 ID.
_platform: 머신 플랫폼(예:
x86_64).
_source_host: 클라이언트가 실행 중인 머신의 호스트 이름.
_thread: 클라이언트 스레드 ID(Windows 전용).
MySQL Connector/J는 다음 attribute를 정의합니다:
_client_name: 클라이언트 이름
_client_version: 클라이언트 라이브러리 버전
_os: 운영체제(예:
Linux, Win64)
_client_license: connector 라이선스 타입
_platform: 머신 플랫폼(예:
x86_64)
_runtime_vendor: Java 런타임 환경(JRE) 벤더
_runtime_version: Java 런타임 환경(JRE) 버전
MySQL Connector/NET은 다음 attribute를 정의합니다:
_client_version: 클라이언트 라이브러리 버전.
_os: 운영체제(예:
Linux, Win64).
_pid: 클라이언트 프로세스 ID.
_platform: 머신 플랫폼(예:
x86_64).
_program_name: 클라이언트 이름.
_thread: 클라이언트 스레드 ID(Windows 전용).
Connector/Python 구현은 다음 attribute를 정의합니다. 일부 값과 attribute는 Connector/Python 구현(pure python 또는 c-ext)에 따라 달라집니다:
_client_license: connector의 라이선스 타입;
GPL-2.0 또는
Commercial. (pure python only)
_client_name:
pure python에서는 mysql-connector-python, c-ext에서는
libmysql로 설정.
_client_version: connector 버전
(pure python) 또는 mysqlclient 라이브러리 버전(c-ext).
_os: connector가 사용하는 운영체제(예:
Linux,
Win64).
_pid: 소스 머신에서의 프로세스 식별자(예:
26955)
_platform: 머신 플랫폼(예:
x86_64).
_source_host: connector가 접속하는 쪽 머신의 호스트 이름.
_connector_version: connector 버전
(예: 9.5.0) (c-ext only).
_connector_license: connector의 라이선스 타입;
GPL-2.0 또는
Commercial (c-ext only).
_connector_name: 항상
mysql-connector-python으로 설정 (c-ext only).
PHP는 컴파일 방식에 따라 attribute를 정의합니다:
libmysqlclient를 사용하여 컴파일된 경우: 앞에서 설명한 표준 libmysqlclient attribute.
mysqlnd를 사용하여 컴파일된 경우: 값이
mysqlnd인 _client_name attribute만.
많은 MySQL 클라이언트 프로그램은 값이 클라이언트 이름과 동일한 program_name attribute를 설정합니다. 예를 들어, mysqladmin과 mysqldump는 각각 program_name을
mysqladmin 및 mysqldump로 설정합니다. MySQL Shell은 program_name을
mysqlsh로 설정합니다.
일부 MySQL 클라이언트 프로그램은 추가 attribute를 정의합니다:
os_user: 프로그램을 실행 중인 운영체제 사용자의 이름. Unix 및 Unix 계열 시스템과 Windows에서 사용 가능.
os_sudouser: SUDO_USER 환경 변수의 값. Unix 및 Unix 계열 시스템에서 사용 가능.
mysql connection attribute 중 값이 비어 있는 것들은 전송되지 않습니다.
_client_role:
binary_log_listenerReplica connection:
program_name:
mysqld
_client_role:
binary_log_listener
_client_replication_channel_name: 채널 이름.
FEDERATED 스토리지 엔진 connection:
program_name:
mysqld
_client_role:
federated_storage
클라이언트에서 서버로 전송되는 connection attribute 데이터의 양에는 다음과 같은 제한이 있습니다:
connect 시간 이전에 클라이언트에서 부과하는 고정 제한.
connect 시간에 서버에서 부과하는 고정 제한.
connect 시간에 Performance Schema에서 부과하는 구성 가능한 제한.
C API를 사용하여 시작된 connection의 경우, libmysqlclient 라이브러리는 클라이언트 측에서 connection attribute 데이터의 총 크기에 대해 64KB 제한을 부과합니다. 이 제한을 초과하게 만드는 mysql_options() 호출은 CR_INVALID_PARAMETER_NO error를 생성합니다. 다른 MySQL Connector들은 서버로 전송될 수 있는 connection attribute 데이터 양에 대해 자체적인 클라이언트 측 제한을 부과할 수 있습니다.
서버 측에서는 connection attribute 데이터에 대해 다음과 같은 size check가 발생합니다:
서버는 수락하는 connection attribute 데이터의 총 크기에 대해 64KB 제한을 부과합니다. 클라이언트가 64KB를 초과하는 attribute 데이터를 전송하려고 하면, 서버는 그 connection을 거부합니다. 그렇지 않으면 서버는 attribute 버퍼를 유효한 것으로 간주하고, 이 버퍼 중 가장 긴 것의 크기를 Performance_schema_session_connect_attrs_longest_seen status variable에 기록합니다.
수락된 connection의 경우, Performance Schema는 attribute 총 크기를 performance_schema_session_connect_attrs_size system variable 값과 비교하여 확인합니다. attribute 크기가 이 값을 초과하는 경우, 다음 동작이 발생합니다:
Performance Schema는 attribute 데이터를 잘라내고(truncate) attribute 잘림이 발생한 connection 수를 나타내는 Performance_schema_session_connect_attrs_lost status variable을 증가시킵니다.
log_error_verbosity system variable이 1보다 큰 경우, Performance Schema는 error log에 메시지를 기록합니다:
1Connection attributes of length N were truncated 2(N bytes lost) 3for connection N, user user_name@host_name 4(as user_name), auth: {yes|no}
경고 메시지의 정보는 attribute 잘림이 발생한 클라이언트를 DBA가 식별하는 데 도움이 되도록 의도된 것입니다.
attribute 버퍼에 충분한 공간이 있는 경우, 세션 attribute에 _truncated attribute가 추가되며, 그 값은 몇 바이트가 손실되었는지를 나타냅니다. 이를 통해 Performance Schema는 connection attribute 테이블에서 connection별 잘림 정보를 노출할 수 있습니다. 이 정보는 error log를 확인하지 않고도 조회할 수 있습니다.
29.12.8 Performance Schema Connection Tables
29.12.10 Performance Schema User-Defined Variable Tables