# Fielddata cache sanity check

**URL:** <https://discuss.elastic.co/t/fielddata-cache-sanity-check/22623>\
**Category:** Elasticsearch\
**Created:** [March 11, 2015, 8:02pm UTC](https://discuss.elastic.co/t/fielddata-cache-sanity-check/22623 "2015-03-11T20:02:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drew\_Town](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drew_town/32/44829_2.png) [@Drew\_Town](https://discuss.elastic.co/u/Drew_Town)\
**Post date:** [March 11, 2015, 8:02pm UTC](https://discuss.elastic.co/t/fielddata-cache-sanity-check/22623/1 "2015-03-11T20:02:56Z")

</div>

Hello all,

Just want to make sure my field data settings are going to work in a way  
that will protect my cluster from a bad query.

elasticsearch.yml  
indices.fielddata.cache.size: 11GB

get/\_cluster/settings  
{  
"persistent": {  
"indices": {  
"cache": {  
"filter": {  
"expire": "48h"  
}  
},  
"breaker": {  
"total": {  
"limit": "15GB"  
},  
"fielddata": {  
"limit": "12GB"  
}  
},  
"fielddata": {  
"breaker": {  
"limit": "80%"  
}  
}  
}  
}  
}

Does everything look right here? I tried to get rid of  
indices.fielddata.breaker.limit but it just remains.

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4a2073f5-df80-46ed-abdb-7beca2681f2a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4a2073f5-df80-46ed-abdb-7beca2681f2a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Drew\_Town](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drew_town/32/44829_2.png) [@Drew\_Town](https://discuss.elastic.co/u/Drew_Town)\
**Post date:** [March 19, 2015, 1:08pm UTC](https://discuss.elastic.co/t/fielddata-cache-sanity-check/22623/2 "2015-03-19T13:08:43Z")

</div>

Can anybody comment on this? Does this look ok?

Thanks,

Drew

On Wednesday, March 11, 2015 at 3:02:56 PM UTC-5, Drew Town wrote:

> Hello all,
> 
> Just want to make sure my field data settings are going to work in a way  
> that will protect my cluster from a bad query.
> 
> elasticsearch.yml  
> indices.fielddata.cache.size: 11GB
> 
> get/\_cluster/settings  
> {  
> "persistent": {  
> "indices": {  
> "cache": {  
> "filter": {  
> "expire": "48h"  
> }  
> },  
> "breaker": {  
> "total": {  
> "limit": "15GB"  
> },  
> "fielddata": {  
> "limit": "12GB"  
> }  
> },  
> "fielddata": {  
> "breaker": {  
> "limit": "80%"  
> }  
> }  
> }  
> }  
> }
> 
> Does everything look right here? I tried to get rid of  
> indices.fielddata.breaker.limit but it just remains.
> 
> 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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/11d056b3-60e7-450b-b0ff-f4c95717ca7b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/11d056b3-60e7-450b-b0ff-f4c95717ca7b%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:** [March 19, 2015, 4:44pm UTC](https://discuss.elastic.co/t/fielddata-cache-sanity-check/22623/3 "2015-03-19T16:44:58Z")

</div>

It's not really worth flushing things from cache based on time,  
Elasticsearch uses LRU (last recently used) to clear things and it's best  
to just let that handle it.

Don't forget that allowing that much fielddata in your heap means there is  
less for actual good things to happen, as the JVM cannot GC this data from  
the heap. If you are seeing a lot of field data then you're probably better  
off leveraging doc values.

On 19 March 2015 at 06:08, Drew Town [drew.town@gmail.com](mailto:drew.town@gmail.com) wrote:

> Can anybody comment on this? Does this look ok?
> 
> Thanks,
> 
> Drew
> 
> On Wednesday, March 11, 2015 at 3:02:56 PM UTC-5, Drew Town wrote:
> 
> > Hello all,
> > 
> > Just want to make sure my field data settings are going to work in a way  
> > that will protect my cluster from a bad query.
> > 
> > elasticsearch.yml  
> > indices.fielddata.cache.size: 11GB
> > 
> > get/\_cluster/settings  
> > {  
> > "persistent": {  
> > "indices": {  
> > "cache": {  
> > "filter": {  
> > "expire": "48h"  
> > }  
> > },  
> > "breaker": {  
> > "total": {  
> > "limit": "15GB"  
> > },  
> > "fielddata": {  
> > "limit": "12GB"  
> > }  
> > },  
> > "fielddata": {  
> > "breaker": {  
> > "limit": "80%"  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > Does everything look right here? I tried to get rid of  
> > indices.fielddata.breaker.limit but it just remains.
> > 
> > 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/11d056b3-60e7-450b-b0ff-f4c95717ca7b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/11d056b3-60e7-450b-b0ff-f4c95717ca7b%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/11d056b3-60e7-450b-b0ff-f4c95717ca7b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/11d056b3-60e7-450b-b0ff-f4c95717ca7b%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/CAEYi1X\_NJvJn9STGqTEz%3DZth3HyKL250DDHfbkhCv3Uy7pRUYA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X_NJvJn9STGqTEz%3DZth3HyKL250DDHfbkhCv3Uy7pRUYA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Drew\_Town](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drew_town/32/44829_2.png) [@Drew\_Town](https://discuss.elastic.co/u/Drew_Town)\
**Post date:** [March 25, 2015, 1:10pm UTC](https://discuss.elastic.co/t/fielddata-cache-sanity-check/22623/4 "2015-03-25T13:10:02Z")

</div>

Mark,

Thanks for the idea of using doc values. I added our @timestamp field to  
doc values and it has made a huge impact on reducing our field data cache  
size with only a pretty minimal impact on performance. It has worked so  
well I may actually add some more commonly used fields to doc values.

Thanks,

Drew

On Thursday, March 19, 2015 at 11:45:26 AM UTC-5, Mark Walkom wrote:

> It's not really worth flushing things from cache based on time,  
> Elasticsearch uses LRU (last recently used) to clear things and it's best  
> to just let that handle it.
> 
> Don't forget that allowing that much fielddata in your heap means there is  
> less for actual good things to happen, as the JVM cannot GC this data from  
> the heap. If you are seeing a lot of field data then you're probably better  
> off leveraging doc values.
> 
> On 19 March 2015 at 06:08, Drew Town \<[drew...@gmail.com](mailto:drew...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Can anybody comment on this? Does this look ok?
> > 
> > Thanks,
> > 
> > Drew
> > 
> > On Wednesday, March 11, 2015 at 3:02:56 PM UTC-5, Drew Town wrote:
> > 
> > > Hello all,
> > > 
> > > Just want to make sure my field data settings are going to work in a way  
> > > that will protect my cluster from a bad query.
> > > 
> > > elasticsearch.yml  
> > > indices.fielddata.cache.size: 11GB
> > > 
> > > get/\_cluster/settings  
> > > {  
> > > "persistent": {  
> > > "indices": {  
> > > "cache": {  
> > > "filter": {  
> > > "expire": "48h"  
> > > }  
> > > },  
> > > "breaker": {  
> > > "total": {  
> > > "limit": "15GB"  
> > > },  
> > > "fielddata": {  
> > > "limit": "12GB"  
> > > }  
> > > },  
> > > "fielddata": {  
> > > "breaker": {  
> > > "limit": "80%"  
> > > }  
> > > }  
> > > }  
> > > }  
> > > }
> > > 
> > > Does everything look right here? I tried to get rid of  
> > > indices.fielddata.breaker.limit but it just remains.
> > > 
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/11d056b3-60e7-450b-b0ff-f4c95717ca7b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/11d056b3-60e7-450b-b0ff-f4c95717ca7b%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/11d056b3-60e7-450b-b0ff-f4c95717ca7b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/11d056b3-60e7-450b-b0ff-f4c95717ca7b%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/97ca2390-5944-4b9b-90cb-ddf595b46293%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/97ca2390-5944-4b9b-90cb-ddf595b46293%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:24am UTC](https://discuss.elastic.co/t/fielddata-cache-sanity-check/22623/5 "2017-07-06T00:24:06Z")

</div>


