性能模式实现了几个状态变量,这些变量提供有关因内存限制而无法加载或创建的检测信息:The Performance Schema implements several status variables that provide information about instrumentation that could not be loaded or created due to memory constraints:
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_index_stat_lost | 0 |
| Performance_schema_locker_lost | 0 |
| Performance_schema_memory_classes_lost | 0 |
| Performance_schema_metadata_lock_lost | 0 |
| Performance_schema_meter_lost | 0 |
| Performance_schema_metric_lost | 0 |
| Performance_schema_mutex_classes_lost | 0 |
| Performance_schema_mutex_instances_lost | 0 |
| Performance_schema_nested_statement_lost | 0 |
| Performance_schema_prepared_statements_lost | 0 |
| Performance_schema_program_lost | 0 |
| Performance_schema_rwlock_classes_lost | 0 |
| Performance_schema_rwlock_instances_lost | 0 |
| Performance_schema_session_connect_attrs_longest_seen | 131 |
| 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_table_lock_stat_lost | 0 |
| Performance_schema_thread_classes_lost | 0 |
| Performance_schema_thread_instances_lost | 0 |
| Performance_schema_users_lost | 0 |
+-------------------------------------------------------+-------+
有关使用这些变量检查性能模式状态的信息,请参见 第 29.7 节,“性能模式状态监控”。For information on using these variables to check Performance Schema status, see Section 29.7, “Performance Schema Status Monitoring”.
性能模式状态变量具有以下含义:Performance Schema status variables have the following meanings:
Performance_schema_accounts_lost由于
accounts表已满而无法添加行的次数。The number of times a row could not be added to theaccountstable because it was full.Performance_schema_cond_classes_lost有多少条件工具无法加载。How many condition instruments could not be loaded.
Performance_schema_cond_instances_lost有多少条件工具实例无法创建。How many condition instrument instances could not be created.
Performance_schema_digest_lost在
events_statements_summary_by_digest表中无法被监控的摘要实例数。如果performance_schema_digests_size的值过小,则此值可能不为零。The number of digest instances that could not be instrumented in theevents_statements_summary_by_digesttable. This can be nonzero if the value ofperformance_schema_digests_sizeis too small.Performance_schema_file_classes_lost有多少文件工具未能加载。How many file instruments could not be loaded.
Performance_schema_file_handles_lost有多少文件工具实例未能打开。How many file instrument instances could not be opened.
Performance_schema_file_instances_lost有多少文件工具实例未能创建。How many file instrument instances could not be created.
由于
hosts表已满,无法添加行的次数。The number of times a row could not be added to thehoststable because it was full.Performance_schema_index_stat_lost丢失统计信息的索引数量。如果
performance_schema_max_index_stat的值太小,可能会导致该值非零。The number of indexes for which statistics were lost. This can be nonzero if the value ofperformance_schema_max_index_statis too small.Performance_schema_locker_lost由于以下情况,有多少事件被“丢失”或未记录:How many events are “lost” or not recorded, due to the following conditions:
事件是递归的(例如,等待 A 导致等待 B,而 B 又导致等待 C)。Events are recursive (for example, waiting for A caused a wait on B, which caused a wait on C).
嵌套事件堆栈的深度超过实现所规定的限制。The depth of the nested events stack is greater than the limit imposed by the implementation.
Performance Schema 记录的事件不是递归的,因此此变量应始终为 0。Events recorded by the Performance Schema are not recursive, so this variable should always be 0.
Performance_schema_memory_classes_lost内存工具无法加载的次数。The number of times a memory instrument could not be loaded.
Performance_schema_metadata_lock_lost在
metadata_locks表中无法被监测的元数据锁数量。如果performance_schema_max_metadata_locks的值太小,则可能不为零。The number of metadata locks that could not be instrumented in themetadata_lockstable. This can be nonzero if the value ofperformance_schema_max_metadata_locksis too small.未能创建的计量仪器数量。Number of meter instruments that failed to be created.
Performance_schema_metric_lost未能创建的指标仪器数量。Number of metric instruments that failed to be created.
Performance_schema_mutex_classes_lost无法加载的互斥仪器数量。How many mutex instruments could not be loaded.
Performance_schema_mutex_instances_lost无法创建的互斥仪器实例数量。How many mutex instrument instances could not be created.
Performance_schema_nested_statement_lost已存储程序语句的统计信息丢失数量。如果
performance_schema_max_statement_stack的值太小,该值可能非零。The number of stored program statements for which statistics were lost. This can be nonzero if the value ofperformance_schema_max_statement_stackis too small.Performance_schema_prepared_statements_lost在
prepared_statements_instances表中无法被检测的准备语句数量。如果performance_schema_max_prepared_statements_instances的值太小,这个值可能不为零。The number of prepared statements that could not be instrumented in theprepared_statements_instancestable. This can be nonzero if the value ofperformance_schema_max_prepared_statements_instancesis too small.Performance_schema_program_lost已丢失统计信息的存储程序数量。如果
performance_schema_max_program_instances的值太小,这个值可能非零。The number of stored programs for which statistics were lost. This can be nonzero if the value ofperformance_schema_max_program_instancesis too small.Performance_schema_rwlock_classes_lost无法加载的 rwlock 工具数量。How many rwlock instruments could not be loaded.
Performance_schema_rwlock_instances_lost无法创建的 rwlock 工具实例数量。How many rwlock instrument instances could not be created.
Performance_schema_session_connect_attrs_longest_seen除了 Performance Schema 针对
performance_schema_session_connect_attrs_size系统变量的值执行的连接属性大小限制检查之外,服务器还执行初步检查,对它接受的连接属性数据总大小施加 64KB 的限制。如果客户端尝试发送超过 64KB 的属性数据,服务器将拒绝连接。否则,服务器会将属性缓冲区视为有效,并在Performance_schema_session_connect_attrs_longest_seen状态变量中跟踪所见最长缓冲区的大小。如果该值大于performance_schema_session_connect_attrs_size,DBA 可能希望增加该变量的值,或者调查哪些客户端发送了大量的属性数据。In addition to the connection attribute size-limit check performed by the Performance Schema against the value of theperformance_schema_session_connect_attrs_sizesystem variable, the server performs a preliminary check, imposing a limit of 64KB on the aggregate size of connection attribute data it accepts. If a client attempts to send more than 64KB of attribute data, the server rejects the connection. Otherwise, the server considers the attribute buffer valid and tracks the size of the longest such buffer in thePerformance_schema_session_connect_attrs_longest_seenstatus variable. If this value is larger thanperformance_schema_session_connect_attrs_size, DBAs may wish to increase the latter value, or, alternatively, investigate which clients are sending large amounts of attribute data.有关连接属性的更多信息,请参阅 第 29.12.9 节,“性能模式连接属性表”。For more information about connection attributes, see Section 29.12.9, “Performance Schema Connection Attribute Tables”.
Performance_schema_session_connect_attrs_lost已发生连接属性截断的连接数量。对于某个特定连接,如果客户端发送的连接属性键值对的总大小超过由
performance_schema_session_connect_attrs_size系统变量的值允许的保留存储量,性能模式会截断属性数据,并增加Performance_schema_session_connect_attrs_lost。如果该值非零,您可能希望将performance_schema_session_connect_attrs_size设置为更大的值。The number of connections for which connection attribute truncation has occurred. For a given connection, if the client sends connection attribute key-value pairs for which the aggregate size is larger than the reserved storage permitted by the value of theperformance_schema_session_connect_attrs_sizesystem variable, the Performance Schema truncates the attribute data and incrementsPerformance_schema_session_connect_attrs_lost. If this value is nonzero, you may wish to setperformance_schema_session_connect_attrs_sizeto a larger value.有关连接属性的更多信息,请参阅 第 29.12.9 节,“性能模式连接属性表”。For more information about connection attributes, see Section 29.12.9, “Performance Schema Connection Attribute Tables”.
Performance_schema_socket_classes_lost无法加载的套接字工具数。How many socket instruments could not be loaded.
Performance_schema_socket_instances_lost无法创建的套接字工具实例数。How many socket instrument instances could not be created.
Performance_schema_stage_classes_lost无法加载的阶段工具数。How many stage instruments could not be loaded.
Performance_schema_statement_classes_lost有多少语句工具无法加载。How many statement instruments could not be loaded.
Performance_schema_table_handles_lost有多少表工具实例无法打开。如果
performance_schema_max_table_handles的值太小,则可能非零。How many table instrument instances could not be opened. This can be nonzero if the value ofperformance_schema_max_table_handlesis too small.Performance_schema_table_instances_lost无法创建的表仪表实例数量。How many table instrument instances could not be created.
Performance_schema_table_lock_stat_lost丢失锁统计信息的表的数量。如果
performance_schema_max_table_lock_stat的值太小,则可能不为零。The number of tables for which lock statistics were lost. This can be nonzero if the value ofperformance_schema_max_table_lock_statis too small.Performance_schema_thread_classes_lost有多少线程工具无法加载。How many thread instruments could not be loaded.
Performance_schema_thread_instances_lost无法在
threads表中进行检测的线程实例数量。如果performance_schema_max_thread_instances的值太小,则可能为非零。The number of thread instances that could not be instrumented in thethreadstable. This can be nonzero if the value ofperformance_schema_max_thread_instancesis too small.由于
users表已满而无法添加行的次数。The number of times a row could not be added to theuserstable because it was full.