# How many CPUs should be allocated to an Elasticsearch node that doesn't store data?

**URL:** <https://discuss.elastic.co/t/how-many-cpus-should-be-allocated-to-an-elasticsearch-node-that-doesnt-store-data/118729>\
**Category:** Elasticsearch\
**Created:** [February 6, 2018, 11:20pm UTC](https://discuss.elastic.co/t/how-many-cpus-should-be-allocated-to-an-elasticsearch-node-that-doesnt-store-data/118729 "2018-02-06T23:20:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shanim](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@shanim](https://discuss.elastic.co/u/shanim)\
**Post date:** [February 6, 2018, 11:20pm UTC](https://discuss.elastic.co/t/how-many-cpus-should-be-allocated-to-an-elasticsearch-node-that-doesnt-store-data/118729/1 "2018-02-06T23:20:18Z")

</div>

I raised this [question on stackoverflow](https://stackoverflow.com/questions/48633351/how-many-cpus-should-be-allocated-to-an-elasticsearch-node-that-doesnt-store-da). Would you be able to help answer this?

The Elasticsearch documentation recommends using multi-core processors for Elasticsearch nodes but doesn't recommend the number of CPU cores required for peak performance of indexing and searches. Based on the answer to the (question on maxing out CPUs in Elasticsearch)[[https://stackoverflow.com/questions/33611302/how-to-max-out-cpu-cores-on-elasticsearch-cluster](https://stackoverflow.com/questions/33611302/how-to-max-out-cpu-cores-on-elasticsearch-cluster)] during a search on elasticsearch, each shard of an index would utilize one CPU thread during searches.

If I were to deploy Elasticsearch with the following architecture:

- 3 Master only nodes  
`node.master: true`  
`node.data:false`
- 3 Search load-balancer nodes  
`node.master: false`  
`node.data:false`
- 3 or more Data nodes with number\_of\_replicas = 2 and number\_of\_shards = 8 for each index hosted on these nodes  
`node.master: false`  
`node.data:true`

then,

1. Does the Search Load-balancer nodes need 1 CPU per shard like the Data nodes to process the searches on the indexes or can it process the searches efficiently with a lower CPU count of 2 or 4?
2. Does the Master node need 1 CPU per shard to process the ingest traffic or would this be an inefficient design?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 6, 2018, 11:33pm UTC](https://discuss.elastic.co/t/how-many-cpus-should-be-allocated-to-an-elasticsearch-node-that-doesnt-store-data/118729/2 "2018-02-06T23:33:52Z")

</div>

> [@shanim](#):
>
> but doesn't recommend the number of CPU cores required for peak performance of indexing and searches

Because that depends on a number of variables.

1. It'll work fine with 2-4
2. If you have master only nodes, don't use them for _anything else_. Use your coordinating nodes instead.

---

<div class="post-metadata">

**Author:** ![shanim](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@shanim](https://discuss.elastic.co/u/shanim)\
**Post date:** [February 7, 2018, 12:00am UTC](https://discuss.elastic.co/t/how-many-cpus-should-be-allocated-to-an-elasticsearch-node-that-doesnt-store-data/118729/3 "2018-02-07T00:00:10Z")

</div>

> If you have master only nodes, don't use them for anything else. Use your coordinating nodes instead.

- Does this imply that setting the master node with 2 CPUs should be sufficient?
- I assume the co-ordinating nodes are the nodes I referred to as "search load-balancers" or are they data nodes?

I am trying to keep the cost of the cluster low and would like to add as many CPUs as I can afford on the data nodes (with around 32Gb of memory allocated) while keeping the search load-balancer and the master only nodes lightweight. Are there any disadvantages in this approach?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 7, 2018, 12:04am UTC](https://discuss.elastic.co/t/how-many-cpus-should-be-allocated-to-an-elasticsearch-node-that-doesnt-store-data/118729/4 "2018-02-07T00:04:25Z")

</div>

> [@shanim](#):
>
> Does this imply that setting the master node with 2 CPUs should be sufficient?

Cluster state operations are single threaded to ensure consistency, so one for that and one for the OS is ++

> [@shanim](#):
>
> I assume the co-ordinating nodes are the nodes I referred to as "search load-balancers" or are they data nodes?

Yes, the "official" name for that is coordinating nodes 😉

> [@shanim](#):
>
> Are there any disadvantages in this approach?

Nope, totally sane idea.

---

<div class="post-metadata">

**Author:** ![shanim](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@shanim](https://discuss.elastic.co/u/shanim)\
**Post date:** [February 7, 2018, 12:22am UTC](https://discuss.elastic.co/t/how-many-cpus-should-be-allocated-to-an-elasticsearch-node-that-doesnt-store-data/118729/5 "2018-02-07T00:22:44Z")

</div>

Awesome! Thanks! 🙇‍♂️

Mind if I link this thread as the solution to the stackoverflow question?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 7, 2018, 12:33am UTC](https://discuss.elastic.co/t/how-many-cpus-should-be-allocated-to-an-elasticsearch-node-that-doesnt-store-data/118729/6 "2018-02-07T00:33:38Z")

</div>

Go for it 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 7, 2018, 12:34am UTC](https://discuss.elastic.co/t/how-many-cpus-should-be-allocated-to-an-elasticsearch-node-that-doesnt-store-data/118729/7 "2018-03-07T00:34:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
