# Elasticsearch field cache always filled up and prevents other query to run

**URL:** https://discuss.elastic.co/t/elasticsearch-field-cache-always-filled-up-and-prevents-other-query-to-run/17162
**Category:** Elasticsearch
**Created:** [April 24, 2014, 1:42am UTC](https://discuss.elastic.co/t/elasticsearch-field-cache-always-filled-up-and-prevents-other-query-to-run/17162 "2014-04-24T01:42:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Olivier\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olivier_b/32/1422_2.png) [@Olivier\_B](https://discuss.elastic.co/u/Olivier_B)
#### Post date: [April 24, 2014, 1:42am UTC](https://discuss.elastic.co/t/elasticsearch-field-cache-always-filled-up-and-prevents-other-query-to-run/17162/1 "2014-04-24T01:42:24Z")

</div>

Hi all,

I set up an index containing 500.000 with million nested documents and I  
run big queries with a lot of aggregation. As expected this is using a LOT  
of memory and I easily have an OutOfMemory exception if a user perform a  
query for too many documents  
So I configured elasticsearch with the folloting:

indices.fielddata.cache.size: 20%  
indices.fielddata.breaker.limit: 20%  
indices.fielddata.breaker.overhead: 1.2  
indices.fielddata.cache.expiry: 1m  
indices.cache.filter.size: 20%  
indices.cache.filter.expire: 1m

(I've two nodes with one index running on m3.xlarge EC2 instances with 5  
shards per node HEAP size is 8G (half of total RAM)).

Now I've well this beautiful error message when a user is performing a big  
query:

CircuitBreakingException[Data too large, data would be larger than limit of  
[2570007347] bytes

If I check the nodes, the field cache reached its maximum size (1.6G) as  
expected. Then I can easily returned an error message to the user telling  
him to downsize the scope of its query and it should be fine.

But... This will never let me run a query anymore!

The cache is filled up for ever and all query, even basic small search  
(without aggregation) will be responded with the CircuitBreakingException.

The only way I found so far is manually clearing the cache. Of course this  
is not an acceptable solution for production.

\*How can I make sure this cache will never be continuously filled up? \*

How can I automatically remove from the cache unused data?

Does indices.fielddata.cache.expiry config param actually work?

Thanks all!

--  
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/72f68e09-c670-494c-af77-328e37e4aa0f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/72f68e09-c670-494c-af77-328e37e4aa0f%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, 1:33am UTC](https://discuss.elastic.co/t/elasticsearch-field-cache-always-filled-up-and-prevents-other-query-to-run/17162/2 "2017-07-06T01:33:53Z")

</div>


