# Suggestion: Is it possible to avoid Aggregations crating too many buckets?

**URL:** <https://discuss.elastic.co/t/suggestion-is-it-possible-to-avoid-aggregations-crating-too-many-buckets/82811>\
**Category:** Elasticsearch\
**Created:** [April 19, 2017, 3:20am UTC](https://discuss.elastic.co/t/suggestion-is-it-possible-to-avoid-aggregations-crating-too-many-buckets/82811 "2017-04-19T03:20:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chenjinyuan87](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@chenjinyuan87](https://discuss.elastic.co/u/chenjinyuan87)\
**Post date:** [April 19, 2017, 3:20am UTC](https://discuss.elastic.co/t/suggestion-is-it-possible-to-avoid-aggregations-crating-too-many-buckets/82811/1 "2017-04-19T03:20:57Z")

</div>

Hi,  
I found when doing aggregation, some times it creates millions of empty buckets. Thus the service collapse because out of memory error.

Obviously, it's the users problem. I'm now working on finding out the internal reason for this problem.  
But i suggest that elastic should check this problem. i.e. when emptying buckets is more than 1 million, stop the aggregation, and throw an exception.

This problem broke down my cluster more than five times these days. The same aggregation works well in the past several months. I think it should be some special data in the index. But now i didn't find what's the data.

---

<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:** [May 17, 2017, 3:26am UTC](https://discuss.elastic.co/t/suggestion-is-it-possible-to-avoid-aggregations-crating-too-many-buckets/82811/2 "2017-05-17T03:26:34Z")

</div>

Closed on May 17, 2017, 3:26am UTC

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