# Best cache settings for static data in large index

**URL:** <https://discuss.elastic.co/t/best-cache-settings-for-static-data-in-large-index/12551>\
**Category:** Elasticsearch\
**Created:** [June 26, 2013, 11:49am UTC](https://discuss.elastic.co/t/best-cache-settings-for-static-data-in-large-index/12551 "2013-06-26T11:49:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_MZ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mz/32/2215_2.png) [@David\_MZ](https://discuss.elastic.co/u/David_MZ)\
**Post date:** [June 26, 2013, 11:49am UTC](https://discuss.elastic.co/t/best-cache-settings-for-static-data-in-large-index/12551/1 "2013-06-26T11:49:52Z")

</div>

I have a 180 million documents index (over 1 node and 1 shard), the index  
is static I do not update it  
I want to have best performance possible, I have 16 gigs of ram on my  
machine

I have a intuition that there are some cache options that I can leverage.

Any ideas what might I need to configure

Thanks

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [June 26, 2013, 12:48pm UTC](https://discuss.elastic.co/t/best-cache-settings-for-static-data-in-large-index/12551/2 "2013-06-26T12:48:55Z")

</div>

I would run an optimize on this index and set `max_num_segments` to 1:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

This boost the performance of all search related operations.

if you use filters, I would also increase the size of the filter cache:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On 26 June 2013 13:49, David MZ [david.mazvovsky@gmail.com](mailto:david.mazvovsky@gmail.com) wrote:

> I have a 180 million documents index (over 1 node and 1 shard), the index  
> is static I do not update it  
> I want to have best performance possible, I have 16 gigs of ram on my  
> machine
> 
> I have a intuition that there are some cache options that I can leverage.
> 
> Any ideas what might I need to configure
> 
> Thanks
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![David\_MZ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_mz/32/2215_2.png) [@David\_MZ](https://discuss.elastic.co/u/David_MZ)\
**Post date:** [June 26, 2013, 12:55pm UTC](https://discuss.elastic.co/t/best-cache-settings-for-static-data-in-large-index/12551/3 "2013-06-26T12:55:55Z")

</div>

If I have only 16gigs of ram, can I set more than 50% to elastic, I don't  
have load at all, but once a query hits I want it to be fast  
is larger heap size going to help me

I read that it's recommended to leave 50% to the OS, is that still true in  
my scenario

On Wed, Jun 26, 2013 at 3:48 PM, Martijn v Groningen \<  
[martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:

> I would run an optimize on this index and set `max_num_segments` to 1:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize/)
> 
> This boost the performance of all search related operations.
> 
> if you use filters, I would also increase the size of the filter cache:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/cache/)
> 
> On 26 June 2013 13:49, David MZ [david.mazvovsky@gmail.com](mailto:david.mazvovsky@gmail.com) wrote:
> 
> > I have a 180 million documents index (over 1 node and 1 shard), the index  
> > is static I do not update it  
> > I want to have best performance possible, I have 16 gigs of ram on my  
> > machine
> > 
> > I have a intuition that there are some cache options that I can leverage.
> > 
> > Any ideas what might I need to configure
> > 
> > Thanks
> > 
> > --  
> > 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).
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/VJQ0mQJy\_\_s/unsubscribe](https://groups.google.com/d/topic/elasticsearch/VJQ0mQJy__s/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [June 26, 2013, 1:12pm UTC](https://discuss.elastic.co/t/best-cache-settings-for-static-data-in-large-index/12551/4 "2013-06-26T13:12:53Z")

</div>

Yes that is still true in your scenario, the filesystem cache will  
eventually use the unused ram, and make your queries in general faster.  
How much of the heap is actually used? You can check this via the node  
stats api (use the jvm option):

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On 26 June 2013 14:55, David MZ [david.mazvovsky@gmail.com](mailto:david.mazvovsky@gmail.com) wrote:

> If I have only 16gigs of ram, can I set more than 50% to elastic, I don't  
> have load at all, but once a query hits I want it to be fast  
> is larger heap size going to help me
> 
> I read that it's recommended to leave 50% to the OS, is that still true in  
> my scenario
> 
> On Wed, Jun 26, 2013 at 3:48 PM, Martijn v Groningen \<  
> [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:
> 
> > I would run an optimize on this index and set `max_num_segments` to 1:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize/)
> > 
> > This boost the performance of all search related operations.
> > 
> > if you use filters, I would also increase the size of the filter cache:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/cache/)
> > 
> > On 26 June 2013 13:49, David MZ [david.mazvovsky@gmail.com](mailto:david.mazvovsky@gmail.com) wrote:
> > 
> > > I have a 180 million documents index (over 1 node and 1 shard), the  
> > > index is static I do not update it  
> > > I want to have best performance possible, I have 16 gigs of ram on my  
> > > machine
> > > 
> > > I have a intuition that there are some cache options that I can leverage.
> > > 
> > > Any ideas what might I need to configure
> > > 
> > > Thanks
> > > 
> > > --  
> > > 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).
> > > 
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > Met vriendelijke groet,
> > 
> > Martijn van Groningen
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/VJQ0mQJy\_\_s/unsubscribe](https://groups.google.com/d/topic/elasticsearch/VJQ0mQJy__s/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:29am UTC](https://discuss.elastic.co/t/best-cache-settings-for-static-data-in-large-index/12551/5 "2017-07-06T02:29:23Z")

</div>


