<p>We are debating the best node size for our production GKE cluster.</p>

<p>Is it better to have more smaller nodes or less larger nodes in general?</p>

<p>e.g. we are choosing between the following two options</p>

<ol>
<li>3 x n1-standard-2 (7.5GB 2vCPU)</li>
<li>2 x n1-standard-4 (15GB 4vCPU)</li>
</ol>

<p>We run on these nodes:</p>

<ul>
<li>Elastic search cluster</li>
<li>Redis cluster</li>
<li>PHP API microservice</li>
<li>Node API microservice</li>
<li>3 x seperate Node / React websites</li>
</ul>

<p>Two things to consider in my opinion:</p>

<ul>
<li><strong>Replication</strong>: </li>
</ul>

<p>services like Elasticsearch or Redis cluster / sentinel are only able to provide reliable redundancy if there are enough Pods running the service: if you have 2 nodes, 5 elasticsearch Pods, well chances are 3 Pods will be on one node and 2 on the other: you maximum replication will be 2. If you happen to have 2 replica Pods on the same node and it goes down, you lose the whole index.</p>

<p>[EDIT]: if you use persistent block storage (this best for persistence but is complex to setup since each node needs its own block, making scaling tricky), you would not 'lose the whole index', but this is true if you rely on local storage.</p>

<p>For this reason, more nodes is better.</p>

<ul>
<li><strong>Performance</strong>:</li>
</ul>

<p>Obviously, you need enough resources. Smaller nodes have lower resources, so if a Pod starts getting lots of traffic, it will be more easily reaching its limit and Pods will be ejected. </p>

<p>Elasticsearch is quite a memory hog. You'll have to figure if running all these Pods require bigger nodes.</p>

<p>In the end, as your need grow, you will probably want to use a mix of different capacity nodes, which in GKE will have labels for capacity which can be used to set resources quotas and limits for memory and CPU. You can also add your own labels to insure certain Pods end up on certain types of nodes.</p>
