20.7.1 微调组通信线程
The group communication thread (GCT) runs in a loop while the Group Replication plugin is loaded. The GCT receives messages from the group and from the plugin, handles quorum and failure detection related tasks, sends out some keep alive messages and also handles the incoming and outgoing transactions from/to the server/group. The GCT waits for incoming messages in a queue. When there are no messages, the GCT waits. By configuring this wait to be a little longer (doing an active wait) before actually going to sleep can prove to be beneficial in some cases. This is because the alternative is for the operating system to switch out the GCT from the processor and do a context switch.
To force the GCT to do an active wait, use the group_replication_poll_spin_loops
option, which makes the GCT loop, doing nothing relevant for the configured number of loops, before actually polling the queue for the next message.
For example:
mysql> SET GLOBAL group_replication_poll_spin_loops= 10000;