# ES 5.2.2: Sudden heap spikes followed by cluster crash

**URL:** https://discuss.elastic.co/t/es-5-2-2-sudden-heap-spikes-followed-by-cluster-crash/80977
**Category:** Elasticsearch
**Created:** [April 3, 2017, 9:51am UTC](https://discuss.elastic.co/t/es-5-2-2-sudden-heap-spikes-followed-by-cluster-crash/80977 "2017-04-03T09:51:08Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![AndreCimander](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrecimander/32/30386_2.png) [@AndreCimander](https://discuss.elastic.co/u/AndreCimander)
#### Post date: [April 4, 2017, 8:21am UTC](https://discuss.elastic.co/t/es-5-2-2-sudden-heap-spikes-followed-by-cluster-crash/80977/2 "2017-04-04T08:21:47Z")

</div>

Hey,

we are also seeing this issue with our 5.2.2 cluster, we have to restart some misbehaving nodes every couple of days at the moment. We managed to bring that number down to a few nodes per week by limiting the query cache to three percent.

Our most recent node crash looks like this (you can clearly see the query cache ramping up until the node is stuck):

 ![](https://us1.discourse-cdn.com/elastic/original/3X/2/b/2bd05abe4b211509f1273fa3001e91805b0a7143.png)

There is also a thread from people that had similar problems, in their case it is related to a bug in aggregations:

> [@ES 2.4 to 5.2 Upgrade Followed By Major Cluster Instability](https://discuss.elastic.co/t/es-2-4-to-5-2-upgrade-followed-by-major-cluster-instability/79943/24):
>
> OK folks, it looks like we have found a solution for our stability issue. After sending ES a heap dump from one of our spikes they were able to [find a bug](https://github.com/elastic/elasticsearch/pull/23797) that affects filters in aggregations. In filtered aggs like the one below the bug causes the filter to be run as a bool query and it is therefore scored. This is a big issue for us bc we make A LOT of these. { "agg\_name":{ "filter":{ "terms":{ "id":[1,2,...] } } } } The temp fix is to use constant\_score like …

Hope this will help you until everything's fixed 🙂

---

_[View the full topic](https://discuss.elastic.co/t/es-5-2-2-sudden-heap-spikes-followed-by-cluster-crash/80977)._
