<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="group-replication-fine-tuning-the-group-communication-thread">
      </a>
      20.7.1 Fine Tuning the Group Communication Thread
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045132229808">
  </a>
  <a class="indexterm" name="idm46045132228288">
  </a>
  <p>
   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.
  </p>
  <p>
   To force the GCT to do an active wait, use the
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_poll_spin_loops">
    <code class="literal">
     group_replication_poll_spin_loops
    </code>
   </a>
   option, which makes the GCT loop, doing nothing relevant for the
      configured number of loops, before actually polling the queue for
      the next message.
  </p>
  <p>
   For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa3825314"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SET</span> <span class="token keyword">GLOBAL</span> group_replication_poll_spin_loops<span class="token operator">=</span> <span class="token number">10000</span><span class="token punctuation">;</span></code></pre>
  </div>
 </div>
 <br/>
</div>
