<p>I'm deploying elasticsearch on kubernetes engine on GCP and running into aperformance issue. Elasticsearch determines the size of various thread pools based on the number of cores. Even though I have an 32 core VM created, the thread pool size is just 1. </p>

<p>I did write a test program to print the <code>Runtime.getRuntime().availableProcessors()</code> and it just prints as 1. </p>

<p>I guess it has something to do with the "Container-Optimized OS" which is the only OS allowed on the VMs using Kubernetes Engine. When i create an Debian VM on GCP the <code>Runtime.getRuntime().availableProcessors()</code> returns 8. Not sure how is elasticsearch is being used on the GCPs kubernetes engine. Any ideas or suggestions are welcome.</p>

<p>When i create an Debian VM on GCP without kubernetes, the <code>Runtime.getRuntime().availableProcessors()</code> returns 8.</p>

<p>you can try</p>
<blockquote>
<p>-XX:ActiveProcessorCount=[host_cpu_count]</p>
</blockquote>
<p>and then</p>
<blockquote>
<p>Runtime.getRuntime().availableProcessors()</p>
</blockquote>
<p>will return</p>
<blockquote>
<p>host_cpu_count</p>
</blockquote>
