# \[metrics:max\_buckets\] vs \[search.max\_buckets\]

**URL:** https://discuss.elastic.co/t/metrics-max-buckets-vs-search-max-buckets/202489
**Category:** Kibana
**Created:** [October 7, 2019, 7:28am UTC](https://discuss.elastic.co/t/metrics-max-buckets-vs-search-max-buckets/202489 "2019-10-07T07:28:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![peropero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peropero/32/53554_2.png) [@peropero](https://discuss.elastic.co/u/peropero)
#### Post date: [October 7, 2019, 7:28am UTC](https://discuss.elastic.co/t/metrics-max-buckets-vs-search-max-buckets/202489/1 "2019-10-07T07:28:57Z")

</div>

● Question  
Is the upper limit for [metrics: max\_buckets] 1000?  
What is the difference between [metrics: max\_buckets] and [search.max\_buckets]?

● Background  
I am using kibana 7.2.0.

The following error was displayed.

> Error in visualization  
> [tsvb]\> Max buckets exceeded: 2040 is greater than 2000, try a larger time interval in the panel options.

After that, if you change the setting from Advanced Setting as follows,

```auto
before-> metrics: max_buckets = 2000 (default)
after-> metrics: max_buckets = 15000

```

The following error was displayed.  
The request for this panel failed

> Try being to create too many buckets. Must be less than or equal to: [10000] but was [10001]. This limit can be set by changing the [search.max\_buckets] cluster level setting.

#elasticksearch

---

<div class="post-metadata">

### Author: ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)
#### Post date: [October 28, 2019, 10:40am UTC](https://discuss.elastic.co/t/metrics-max-buckets-vs-search-max-buckets/202489/2 "2019-10-28T10:40:37Z")

</div>

Hi @peropero

`search.max_buckets` is a cluster level setting that is designed to prevent wrongly aggregations to hurt your cluster. You can change that setting using the [Cluster settings API](https://www.elastic.co/guide/en/elasticsearch/reference/7.2/cluster-update-settings.html)

`metrics: max_buckets` is a Kibana advanced settings used by TSVB to prevent rendering too many data points (this can hurt the browser running the visualization/dashboard).

You have to follow this rule: `metrics:max_buckets <= search:max_buckets`

In your case the error message says: that the aggregation require 2040 buckets (that is below the 10.000 default limit if `search:max_buckets` but above the default `2000` buckets in `metrics:max_buckets`.  
You can configure the `metrics:max_buckets` to something like `3000` or anything below the current `search:max_buckets` value.

---

<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: [November 25, 2019, 10:41am UTC](https://discuss.elastic.co/t/metrics-max-buckets-vs-search-max-buckets/202489/3 "2019-11-25T10:41:58Z")

</div>

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