# Nested aggregation crashes cluster all the time

**URL:** <https://discuss.elastic.co/t/nested-aggregation-crashes-cluster-all-the-time/194034>\
**Category:** Elasticsearch\
**Created:** [August 6, 2019, 2:26pm UTC](https://discuss.elastic.co/t/nested-aggregation-crashes-cluster-all-the-time/194034 "2019-08-06T14:26:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zatom](https://avatars.discourse-cdn.com/v4/letter/z/f0a364/32.png) [@zatom](https://discuss.elastic.co/u/zatom)\
**Post date:** [August 6, 2019, 2:26pm UTC](https://discuss.elastic.co/t/nested-aggregation-crashes-cluster-all-the-time/194034/1 "2019-08-06T14:26:39Z")

</div>

I have had working queries with nested aggregation before with size of millions for field and ids. But, this time I am having issue with similar nested aggregation for 2 different fields. It is crashing the cluster all the time even with the size of 20k. I tried to set the search.max\_buckets to very high number also ( 9 million) so that it would throw an error instead of crashing the whole cluster. But, still it is crashing. What could be the possible reason? I noticed the JVM memory in kibana monitoring goes really high at the time of querying before crashing. I also don't know how to get a hold of log. Do I need to set up anything ? or is there a folder for it inside elasticsearch?  
Thank you

---

<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:** [September 3, 2019, 2:26pm UTC](https://discuss.elastic.co/t/nested-aggregation-crashes-cluster-all-the-time/194034/2 "2019-09-03T14:26:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
