<?xml version="1.0" encoding="UTF-8" ?><oembed><version>1.0</version><provider_name>Jui-Nan Lin&#039;s Blog</provider_name><provider_url>https://jnlin.org</provider_url><author_name>jnlin</author_name><author_url>https://jnlin.org/author/jnlin/</author_url><title>Galera Cluster 的 gcache.size 設定</title><html>&lt;code&gt;gcache.size&lt;/code&gt; 的大小會影響 Node 加入 Cluster 時，需不需要完整複製資料。如果資料更動程度過大，在 gcache 裡面已經找不到更動部份的話，就需要完整複製資料；反之則可以直接 apply gcache 裡面的變更。&lt;a href=&quot;http://www.severalnines.com/blog/understanding-gcache-galera&quot;&gt;Understanding gcache in Galera&lt;/a&gt; 很詳細的說明了 gcache 的用途。

&lt;code&gt;gcache.size&lt;/code&gt; 的預設值是 128MB。查了一下資料，是使用 MMAP 的方式來應用 ((http://www.percona.com/files/presentations/percona-live/nyc-2012/PLNY12-galera-cluster-best-practices.pdf))，所以可以盡量設定大一些。雖然 mysqld 看起來會很肥，但實際上是吃不到那麼多記憶體的。我們是設定成 8G。 </html><type>rich</type></oembed>