# Any settings to limit the max number of buckets?

**URL:** https://discuss.elastic.co/t/any-settings-to-limit-the-max-number-of-buckets/130331
**Category:** Elasticsearch
**Created:** [May 2, 2018, 10:29pm UTC](https://discuss.elastic.co/t/any-settings-to-limit-the-max-number-of-buckets/130331 "2018-05-02T22:29:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![suanmeiguo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suanmeiguo/32/11758_2.png) [@suanmeiguo](https://discuss.elastic.co/u/suanmeiguo)
#### Post date: [May 2, 2018, 10:29pm UTC](https://discuss.elastic.co/t/any-settings-to-limit-the-max-number-of-buckets/130331/1 "2018-05-02T22:29:40Z")

</div>

I have a elasticsearch cluster and kibana dashboard. Kibana is used by external user I don't have control with. They sometimes ran very heavy aggregation query that made elasticsearch ran out of jvm heap space.

So is there a setting I can limit how many buckets to return for aggregation query?

Appreciate your help!

---

<div class="post-metadata">

### Author: ![steven-collins-omega](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steven-collins-omega/32/12276_2.png) [@steven-collins-omega](https://discuss.elastic.co/u/steven-collins-omega)
#### Post date: [May 2, 2018, 10:31pm UTC](https://discuss.elastic.co/t/any-settings-to-limit-the-max-number-of-buckets/130331/2 "2018-05-02T22:31:20Z")

</div>

I believe you're looking for `search.max_buckets`.

---

<div class="post-metadata">

### Author: ![suanmeiguo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suanmeiguo/32/11758_2.png) [@suanmeiguo](https://discuss.elastic.co/u/suanmeiguo)
#### Post date: [May 3, 2018, 12:22am UTC](https://discuss.elastic.co/t/any-settings-to-limit-the-max-number-of-buckets/130331/3 "2018-05-03T00:22:10Z")

</div>

Ah! Awesome. Thank you. Looks like it's not available in my version (5.2.2). But, it's all good. Another reason to upgrade the cluster ;-p

---

<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 31, 2018, 12:22am UTC](https://discuss.elastic.co/t/any-settings-to-limit-the-max-number-of-buckets/130331/4 "2018-05-31T00:22:16Z")

</div>

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