MySQL 性能模式 提供用于监控组复制内存使用情况的仪表。要查看可用的组复制仪表,请执行以下查询:The MySQL Performance Schema provides instrumentation for performance monitoring of Group Replication memory usage. To view the available Group Replication instrumentation, issue the following query:
mysql>SELECT NAME,ENABLED FROM performance_schema.setup_instrumentsWHERE NAME LIKE 'memory/group_rpl/%';+-------------------------------------------------------------------+---------+ | NAME | ENABLED | +-------------------------------------------------------------------+---------+ | memory/group_rpl/write_set_encoded | YES | | memory/group_rpl/certification_data | YES | | memory/group_rpl/certification_data_gc | YES | | memory/group_rpl/certification_info | YES | | memory/group_rpl/transaction_data | YES | | memory/group_rpl/sql_service_command_data | YES | | memory/group_rpl/mysql_thread_queued_task | YES | | memory/group_rpl/message_service_queue | YES | | memory/group_rpl/message_service_received_message | YES | | memory/group_rpl/group_member_info | YES | | memory/group_rpl/consistent_members_that_must_prepare_transaction | YES | | memory/group_rpl/consistent_transactions | YES | | memory/group_rpl/consistent_transactions_prepared | YES | | memory/group_rpl/consistent_transactions_waiting | YES | | memory/group_rpl/consistent_transactions_delayed_view_change | YES | | memory/group_rpl/GCS_XCom::xcom_cache | YES | | memory/group_rpl/Gcs_message_data::m_buffer | YES | +-------------------------------------------------------------------+---------+
有关性能模式的内存仪表和事件的更多信息,请参见 第 29.12.20.10 节,“内存汇总表”。For more information on Performance Schema's memory instrumentation and events, see Section 29.12.20.10, “Memory Summary Tables”.
性能模式对组复制的内存分配进行仪表处理。Performance Schema Group Replication instruments memory allocation for Group Replication.
memory/group_rpl/ 性能模式(Performance Schema)检测包含以下工具:The memory/group_rpl/ Performance Schema
instrumentation contains the following instruments:
write_set_encoded:用于在广播到组成员之前对写集进行编码的内存。write_set_encoded: Memory allocated to encode the write set before it is broadcast to the group members.Gcs_message_data::m_buffer:用于发送到网络的事务数据负载的内存。Gcs_message_data::m_buffer: Memory allocated for the transaction data payload sent to the network.certification_data:用于认证传入事务的内存。certification_data: Memory allocated for certification of incoming transactions.certification_data_gc:用于每个成员发送的 GTID_EXECUTED 的垃圾回收内存。certification_data_gc: Memory allocated for the GTID_EXECUTED sent by each member for garbage collection.certification_info:用于存储认证信息的内存,用于解决并发事务之间的冲突。certification_info: Memory allocated for storage of certification information allocated to resolve conflicts between concurrent transactions.transaction_data:为排队等待插件处理的传入事务分配的内存。transaction_data: Memory allocated for incoming transactions queued for the plugin pipeline.message_service_received_message:为从组复制交付消息服务接收的消息分配的内存。message_service_received_message: Memory allocated to receiving messages from Group Replication delivery message service.sql_service_command_data:为处理内部 SQL 服务命令队列分配的内存。sql_service_command_data: Memory allocated for processing the queue of internal SQL service commands.mysql_thread_queued_task:当将一个依赖于 MySQL 线程的任务添加到处理队列时分配的内存。mysql_thread_queued_task: Memory allocated when a MySQL-thread dependent task is added to the processing queue.message_service_queue:为组复制交付消息服务的排队消息分配的内存。message_service_queue: Memory allocated for queued messages of the Group Replication delivery message service.GCS_XCom::xcom_cache:为作为共识协议一部分在组成员之间交换的消息和元数据的 XCOM 缓存分配的内存。GCS_XCom::xcom_cache: Memory allocated to XCOM ache for messaging and metadata exchanged between group members as part of the consensus protocol.consistent_members_that_must_prepare_transaction: 为了群组复制事务一致性保证而分配的用于存放准备事务成员列表的内存。consistent_members_that_must_prepare_transaction: Memory allocated to hold list of members preparing transaction for Group Replication transaction consistency guarantees.consistent_transactions: 为了群组复制事务一致性保证而分配的用于存放事务及必须准备该事务的成员列表的内存。consistent_transactions: Memory allocated to hold transaction and list of members that must prepare that transaction for Group Replication transaction consistency guarantees.consistent_transactions_prepared: 为了群组复制事务一致性保证而分配的用于存放已准备事务信息列表的内存。consistent_transactions_prepared: Memory allocated to hold list of transaction's info prepared for the Group Replication Transaction Consistency Guarantees.consistent_transactions_waiting: 在处理具有AFTER和BEFORE_AND_AFTER一致性的前置已准备事务时,用于存放事务信息列表的内存。consistent_transactions_waiting: Memory allocated to hold information on a list of transactions while preceding prepared transactions with consistency ofAFTERandBEFORE_AND_AFTERare processed.consistent_transactions_delayed_view_change:为存储视图更改事件列表(view_change_log_event)而分配的内存,由等待准备确认的已准备一致事务延迟。consistent_transactions_delayed_view_change: Memory allocated to hold list of view change events (view_change_log_event) delayed by prepared consistent transactions waiting for prepare acknowledgement.group_member_info:为存储组成员属性而分配的内存。属性如主机名、端口、成员权重和角色等。group_member_info: Memory allocated to hold the group member properties. Properties such as hostname, port, member weight and role, and so on.
在 memory/sql/ 分组中,以下工具也用于监控组复制内存:The following instruments in the memory/sql/
grouping are also used to monitor Group Replication memory:
Log_event:为将事务数据编码为二进制日志格式而分配的内存;这也是组复制传输数据的格式。Log_event: Memory allocated for encoding transaction data into the binary log format; this is the same format in which Group Replication transmits data.write_set_extraction:为事务生成的写集分配的内存,在提交之前使用。write_set_extraction: Memory allocated to the transaction's generated write set before it is committed.Gtid_set::to_string:分配用于存储 GTID 集的字符串表示的内存。Gtid_set::to_string: Memory allocated to stored the string representation of a GTID set.Gtid_set::Interval_chunk:分配用于存储 GTID 对象的内存。Gtid_set::Interval_chunk: Memory allocated to store the GTID object.