# More memory or more CPU cores help better performance?

**URL:** <https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457>\
**Category:** Elasticsearch\
**Created:** [April 29, 2015, 2:17am UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457 "2015-04-29T02:17:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Youxu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/youxu/32/117375_2.png) [@Youxu](https://discuss.elastic.co/u/Youxu)\
**Post date:** [April 29, 2015, 2:17am UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457/1 "2015-04-29T02:17:04Z")

</div>

hi,  
I am building ES on cloud Virtual machines, the cloud platform provides  
different tier VMs to choose, say, 4 CPU cores, 28G memory, or 8 CPU cores,  
14G memory etc. Different kind VM has different cost. To save our cost, I  
want to choose the VM whose cost not exceed our budget and has best  
performance or query.  
So, from query performance point of view, should I choose VM with more CPU  
cores or more memory? Anyone has experience on the best combination of CPU  
& Memory for ES performance?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [April 29, 2015, 3:40am UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457/2 "2015-04-29T03:40:12Z")

</div>

Depends - you will want to do some tests to see what sort of resources your  
use case requires.  
Start with smaller machines and go from there.

On 29 April 2015 at 12:17, Xudong You [xudong.you@gmail.com](mailto:xudong.you@gmail.com) wrote:

> hi,  
> I am building ES on cloud Virtual machines, the cloud platform provides  
> different tier VMs to choose, say, 4 CPU cores, 28G memory, or 8 CPU cores,  
> 14G memory etc. Different kind VM has different cost. To save our cost, I  
> want to choose the VM whose cost not exceed our budget and has best  
> performance or query.  
> So, from query performance point of view, should I choose VM with more CPU  
> cores or more memory? Anyone has experience on the best combination of CPU  
> & Memory for ES performance?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8aSE92XiUnu6JotvRnjXif2kxbQBRSo%2BkUKa8Q1cujTw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8aSE92XiUnu6JotvRnjXif2kxbQBRSo%2BkUKa8Q1cujTw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ishafizan\_Ishak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ishafizan_ishak/32/125655_2.png) [@Ishafizan\_Ishak](https://discuss.elastic.co/u/Ishafizan_Ishak)\
**Post date:** [April 29, 2015, 4:33am UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457/3 "2015-04-29T04:33:32Z")

</div>

question is subjective. good thing abt es is that u scale and throw in  
servers as needed. plus query performance also depends on your index  
settings/mappings/replicas.  
i have a cluster instance at  
digitalocean [Pricing Overview | DigitalOcean](https://www.digitalocean.com/pricing/)

no of nodes: 10

- master: 3 (1gb 1 core)
- client: 5 (512mb 1 core)
- data: 3 (8gb 4 core)

total shards: 82  
~160M docs

On Wednesday, April 29, 2015 at 10:17:04 AM UTC+8, Xudong You wrote:

> hi,  
> I am building ES on cloud Virtual machines, the cloud platform provides  
> different tier VMs to choose, say, 4 CPU cores, 28G memory, or 8 CPU cores,  
> 14G memory etc. Different kind VM has different cost. To save our cost, I  
> want to choose the VM whose cost not exceed our budget and has best  
> performance or query.  
> So, from query performance point of view, should I choose VM with more CPU  
> cores or more memory? Anyone has experience on the best combination of CPU  
> & Memory for ES performance?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ebc21ece-e250-478f-b933-7eb37d0e8dfd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ebc21ece-e250-478f-b933-7eb37d0e8dfd%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [April 29, 2015, 8:30am UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457/4 "2015-04-29T08:30:13Z")

</div>

Can you specify what kind of performance you mean?

- mimimal response time for a single query
- maximum throughput for all queries

For maximum performance, all kind of virtual machines are a bad choice in  
comparison to physical machines in your own data center.

Jörg

On Wed, Apr 29, 2015 at 4:17 AM, Xudong You [xudong.you@gmail.com](mailto:xudong.you@gmail.com) wrote:

> hi,  
> I am building ES on cloud Virtual machines, the cloud platform provides  
> different tier VMs to choose, say, 4 CPU cores, 28G memory, or 8 CPU cores,  
> 14G memory etc. Different kind VM has different cost. To save our cost, I  
> want to choose the VM whose cost not exceed our budget and has best  
> performance or query.  
> So, from query performance point of view, should I choose VM with more CPU  
> cores or more memory? Anyone has experience on the best combination of CPU  
> & Memory for ES performance?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGv8o1kinbWmV18y%3DnJHESKNH21U2s5-w2TDGhwCbHiEQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGv8o1kinbWmV18y%3DnJHESKNH21U2s5-w2TDGhwCbHiEQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Youxu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/youxu/32/117375_2.png) [@Youxu](https://discuss.elastic.co/u/Youxu)\
**Post date:** [April 29, 2015, 9:02am UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457/5 "2015-04-29T09:02:17Z")

</div>

I want better maximum throughput for all queries.  
As for VM vs Physical machines. I agree that physical machines beat VM, but  
our strategy is to move our platform to cloud, so VM is only choice.

On Wednesday, April 29, 2015 at 4:30:19 PM UTC+8, Jörg Prante wrote:

> Can you specify what kind of performance you mean?
> 
> - mimimal response time for a single query
> - maximum throughput for all queries
> 
> For maximum performance, all kind of virtual machines are a bad choice in  
> comparison to physical machines in your own data center.
> 
> Jörg
> 
> On Wed, Apr 29, 2015 at 4:17 AM, Xudong You \<[xudon...@gmail.com](mailto:xudon...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > hi,  
> > I am building ES on cloud Virtual machines, the cloud platform provides  
> > different tier VMs to choose, say, 4 CPU cores, 28G memory, or 8 CPU cores,  
> > 14G memory etc. Different kind VM has different cost. To save our cost, I  
> > want to choose the VM whose cost not exceed our budget and has best  
> > performance or query.  
> > So, from query performance point of view, should I choose VM with more  
> > CPU cores or more memory? Anyone has experience on the best combination of  
> > CPU & Memory for ES performance?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [April 29, 2015, 1:57pm UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457/6 "2015-04-29T13:57:02Z")

</div>

First you need to find out if your workload is CPU-bound or if it is  
network-bound.

If CPU-bound, go for the virtual machine with best CPU equipment.

If network bound, go for the virtual machine that offers best network  
connectivity.

It is very hard to get precise numbers for performance metrics in public  
virtual machines because there are many others using the same resources at  
the the same time in an unpredictable way.

Jörg

On Wed, Apr 29, 2015 at 11:02 AM, Xudong You [xudong.you@gmail.com](mailto:xudong.you@gmail.com) wrote:

> I want better maximum throughput for all queries.  
> As for VM vs Physical machines. I agree that physical machines beat VM,  
> but our strategy is to move our platform to cloud, so VM is only choice.
> 
> On Wednesday, April 29, 2015 at 4:30:19 PM UTC+8, Jörg Prante wrote:
> 
> > Can you specify what kind of performance you mean?
> > 
> > - mimimal response time for a single query
> > - maximum throughput for all queries
> > 
> > For maximum performance, all kind of virtual machines are a bad choice in  
> > comparison to physical machines in your own data center.
> > 
> > Jörg
> > 
> > On Wed, Apr 29, 2015 at 4:17 AM, Xudong You [xudon...@gmail.com](mailto:xudon...@gmail.com) wrote:
> > 
> > > hi,  
> > > I am building ES on cloud Virtual machines, the cloud platform provides  
> > > different tier VMs to choose, say, 4 CPU cores, 28G memory, or 8 CPU cores,  
> > > 14G memory etc. Different kind VM has different cost. To save our cost, I  
> > > want to choose the VM whose cost not exceed our budget and has best  
> > > performance or query.  
> > > So, from query performance point of view, should I choose VM with more  
> > > CPU cores or more memory? Anyone has experience on the best combination of  
> > > CPU & Memory for ES performance?
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFy0%2BNOuOqRD0ia392hY2c9Thr9SXG2%3DQZetMxryjGOtQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFy0%2BNOuOqRD0ia392hY2c9Thr9SXG2%3DQZetMxryjGOtQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Youxu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/youxu/32/117375_2.png) [@Youxu](https://discuss.elastic.co/u/Youxu)\
**Post date:** [April 30, 2015, 5:56am UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457/7 "2015-04-30T05:56:41Z")

</div>

Thanks!  
So per your experience, is Elasticsearch query more CPU-bound or IO-bound?  
Anyway, I will do more perf testing with real data on different VMs to find  
out the best CPU & Memory combination for my case.

On Wednesday, April 29, 2015 at 9:57:12 PM UTC+8, Jörg Prante wrote:

> First you need to find out if your workload is CPU-bound or if it is  
> network-bound.
> 
> If CPU-bound, go for the virtual machine with best CPU equipment.
> 
> If network bound, go for the virtual machine that offers best network  
> connectivity.
> 
> It is very hard to get precise numbers for performance metrics in public  
> virtual machines because there are many others using the same resources at  
> the the same time in an unpredictable way.
> 
> Jörg
> 
> On Wed, Apr 29, 2015 at 11:02 AM, Xudong You \<[xudon...@gmail.com](mailto:xudon...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > I want better maximum throughput for all queries.  
> > As for VM vs Physical machines. I agree that physical machines beat VM,  
> > but our strategy is to move our platform to cloud, so VM is only choice.
> > 
> > On Wednesday, April 29, 2015 at 4:30:19 PM UTC+8, Jörg Prante wrote:
> > 
> > > Can you specify what kind of performance you mean?
> > > 
> > > - mimimal response time for a single query
> > > - maximum throughput for all queries
> > > 
> > > For maximum performance, all kind of virtual machines are a bad choice  
> > > in comparison to physical machines in your own data center.
> > > 
> > > Jörg
> > > 
> > > On Wed, Apr 29, 2015 at 4:17 AM, Xudong You [xudon...@gmail.com](mailto:xudon...@gmail.com) wrote:
> > > 
> > > > hi,  
> > > > I am building ES on cloud Virtual machines, the cloud platform provides  
> > > > different tier VMs to choose, say, 4 CPU cores, 28G memory, or 8 CPU cores,  
> > > > 14G memory etc. Different kind VM has different cost. To save our cost, I  
> > > > want to choose the VM whose cost not exceed our budget and has best  
> > > > performance or query.  
> > > > So, from query performance point of view, should I choose VM with more  
> > > > CPU cores or more memory? Anyone has experience on the best combination of  
> > > > CPU & Memory for ES performance?
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4ebe219f-9422-48ed-a84f-d8606f16a7bf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4ebe219f-9422-48ed-a84f-d8606f16a7bf%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [April 30, 2015, 7:13am UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457/8 "2015-04-30T07:13:26Z")

</div>

As said, it depends.

When bulk-indexing documents, for example, my multi-threaded workload is  
network-bound. It can easily be made CPU-bound by pre-processing documents  
in single thread mode. Certain queries are CPU-bound, others not. If I  
retrieve millions of documents in a row, decompression overweighs query  
execution and result transport time. There are many knobs to turn, for  
example, caching, or scan/scroll. Because of this, there is no fixed rule  
for all situations.

Jörg

On Thu, Apr 30, 2015 at 7:56 AM, Xudong You [xudong.you@gmail.com](mailto:xudong.you@gmail.com) wrote:

> Thanks!  
> So per your experience, is Elasticsearch query more CPU-bound or IO-bound?  
> Anyway, I will do more perf testing with real data on different VMs to find  
> out the best CPU & Memory combination for my case.
> 
> On Wednesday, April 29, 2015 at 9:57:12 PM UTC+8, Jörg Prante wrote:
> 
> > First you need to find out if your workload is CPU-bound or if it is  
> > network-bound.
> > 
> > If CPU-bound, go for the virtual machine with best CPU equipment.
> > 
> > If network bound, go for the virtual machine that offers best network  
> > connectivity.
> > 
> > It is very hard to get precise numbers for performance metrics in public  
> > virtual machines because there are many others using the same resources at  
> > the the same time in an unpredictable way.
> > 
> > Jörg
> > 
> > On Wed, Apr 29, 2015 at 11:02 AM, Xudong You [xudon...@gmail.com](mailto:xudon...@gmail.com) wrote:
> > 
> > > I want better maximum throughput for all queries.  
> > > As for VM vs Physical machines. I agree that physical machines beat VM,  
> > > but our strategy is to move our platform to cloud, so VM is only choice.
> > > 
> > > On Wednesday, April 29, 2015 at 4:30:19 PM UTC+8, Jörg Prante wrote:
> > > 
> > > > Can you specify what kind of performance you mean?
> > > > 
> > > > - mimimal response time for a single query
> > > > - maximum throughput for all queries
> > > > 
> > > > For maximum performance, all kind of virtual machines are a bad choice  
> > > > in comparison to physical machines in your own data center.
> > > > 
> > > > Jörg
> > > > 
> > > > On Wed, Apr 29, 2015 at 4:17 AM, Xudong You [xudon...@gmail.com](mailto:xudon...@gmail.com) wrote:
> > > > 
> > > > > hi,  
> > > > > I am building ES on cloud Virtual machines, the cloud platform  
> > > > > provides different tier VMs to choose, say, 4 CPU cores, 28G memory, or 8  
> > > > > CPU cores, 14G memory etc. Different kind VM has different cost. To save  
> > > > > our cost, I want to choose the VM whose cost not exceed our budget and has  
> > > > > best performance or query.  
> > > > > So, from query performance point of view, should I choose VM with more  
> > > > > CPU cores or more memory? Anyone has experience on the best combination of  
> > > > > CPU & Memory for ES performance?
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/4ebe219f-9422-48ed-a84f-d8606f16a7bf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4ebe219f-9422-48ed-a84f-d8606f16a7bf%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/4ebe219f-9422-48ed-a84f-d8606f16a7bf%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4ebe219f-9422-48ed-a84f-d8606f16a7bf%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFgbp5qii5m2Eq\_JMGPPeGM%2BqZMp-uJuiFUdyOZMkrVXw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFgbp5qii5m2Eq_JMGPPeGM%2BqZMp-uJuiFUdyOZMkrVXw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Youxu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/youxu/32/117375_2.png) [@Youxu](https://discuss.elastic.co/u/Youxu)\
**Post date:** [April 30, 2015, 7:55am UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457/9 "2015-04-30T07:55:57Z")

</div>

Thanks a lot Jörg!

On Thursday, April 30, 2015 at 3:13:36 PM UTC+8, Jörg Prante wrote:

> As said, it depends.
> 
> When bulk-indexing documents, for example, my multi-threaded workload is  
> network-bound. It can easily be made CPU-bound by pre-processing documents  
> in single thread mode. Certain queries are CPU-bound, others not. If I  
> retrieve millions of documents in a row, decompression overweighs query  
> execution and result transport time. There are many knobs to turn, for  
> example, caching, or scan/scroll. Because of this, there is no fixed rule  
> for all situations.
> 
> Jörg
> 
> On Thu, Apr 30, 2015 at 7:56 AM, Xudong You \<[xudon...@gmail.com](mailto:xudon...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Thanks!  
> > So per your experience, is Elasticsearch query more CPU-bound or  
> > IO-bound? Anyway, I will do more perf testing with real data on different  
> > VMs to find out the best CPU & Memory combination for my case.
> > 
> > On Wednesday, April 29, 2015 at 9:57:12 PM UTC+8, Jörg Prante wrote:
> > 
> > > First you need to find out if your workload is CPU-bound or if it is  
> > > network-bound.
> > > 
> > > If CPU-bound, go for the virtual machine with best CPU equipment.
> > > 
> > > If network bound, go for the virtual machine that offers best network  
> > > connectivity.
> > > 
> > > It is very hard to get precise numbers for performance metrics in public  
> > > virtual machines because there are many others using the same resources at  
> > > the the same time in an unpredictable way.
> > > 
> > > Jörg
> > > 
> > > On Wed, Apr 29, 2015 at 11:02 AM, Xudong You [xudon...@gmail.com](mailto:xudon...@gmail.com) wrote:
> > > 
> > > > I want better maximum throughput for all queries.  
> > > > As for VM vs Physical machines. I agree that physical machines beat VM,  
> > > > but our strategy is to move our platform to cloud, so VM is only choice.
> > > > 
> > > > On Wednesday, April 29, 2015 at 4:30:19 PM UTC+8, Jörg Prante wrote:
> > > > 
> > > > > Can you specify what kind of performance you mean?
> > > > > 
> > > > > - mimimal response time for a single query
> > > > > - maximum throughput for all queries
> > > > > 
> > > > > For maximum performance, all kind of virtual machines are a bad choice  
> > > > > in comparison to physical machines in your own data center.
> > > > > 
> > > > > Jörg
> > > > > 
> > > > > On Wed, Apr 29, 2015 at 4:17 AM, Xudong You [xudon...@gmail.com](mailto:xudon...@gmail.com)  
> > > > > wrote:
> > > > > 
> > > > > > hi,  
> > > > > > I am building ES on cloud Virtual machines, the cloud platform  
> > > > > > provides different tier VMs to choose, say, 4 CPU cores, 28G memory, or 8  
> > > > > > CPU cores, 14G memory etc. Different kind VM has different cost. To save  
> > > > > > our cost, I want to choose the VM whose cost not exceed our budget and has  
> > > > > > best performance or query.  
> > > > > > So, from query performance point of view, should I choose VM with  
> > > > > > more CPU cores or more memory? Anyone has experience on the best  
> > > > > > combination of CPU & Memory for ES performance?
> > > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to the Google  
> > > > > > Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > To view this discussion on the web visit  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com)  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e449f0bb-5c92-4aee-84f5-285171e8070c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > .  
> > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5e1aee9b-f2d5-4340-9a8e-d30b786cda5a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .
> > > > 
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/4ebe219f-9422-48ed-a84f-d8606f16a7bf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4ebe219f-9422-48ed-a84f-d8606f16a7bf%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/4ebe219f-9422-48ed-a84f-d8606f16a7bf%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4ebe219f-9422-48ed-a84f-d8606f16a7bf%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5ca5f17d-c958-4dc8-80fc-623f60a7c733%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5ca5f17d-c958-4dc8-80fc-623f60a7c733%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:16am UTC](https://discuss.elastic.co/t/more-memory-or-more-cpu-cores-help-better-performance/23457/10 "2017-07-06T00:16:49Z")

</div>


