Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear document description about 'search.max_buckets' #34209

Closed
dharada opened this issue Oct 2, 2018 · 7 comments
Closed

Unclear document description about 'search.max_buckets' #34209

dharada opened this issue Oct 2, 2018 · 7 comments
Labels

Comments

@dharada
Copy link
Contributor

dharada commented Oct 2, 2018

[The actual behavior]

  • When we change "search.max_buckets" setting from default to some value, (e.g 1000),
    the requests that try to return more than the limit buckets will occur error.

[Issue]

[Request]

  • Could you please make sure the document more understandable?
@dharada dharada added the >docs General docs changes label Oct 2, 2018
@javanna
Copy link
Member

javanna commented Oct 2, 2018

hi @dharada ,
there is a note in the page that you linked that says:

The maximum number of buckets allowed in a single response is limited by a dynamic cluster setting named search.max_buckets. It is disabled by default (-1) but requests that try to return more than 10,000 buckets (the default value for future versions) will log a deprecation warning.

Do you think that the above note explains the behaviour clearly enough?

@javanna javanna added the :Analytics/Aggregations Aggregations label Oct 2, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@danielmitterdorfer
Copy link
Member

No further feedback received. @dharada if you have the requested
information please add it in a comment and we can look at re-opening
this issue.

@zorze
Copy link

zorze commented Mar 30, 2019

The note does explain the warning. Is there some other place showing how to set the search.max_buckets?

@mayya-sharipova
Copy link
Contributor

@zorze search.max_buckets is a cluster setting, and is set in the same way as all other cluster settings.

@saiergong
Copy link

No further feedback received. @dharada if you have the requested
information please add it in a comment and we can look at re-opening
this issue.

hi, @javanna , does this parameter limit the number of buckets returned or created during aggregation? for example,if one shard create 20000 term buckets during aggregation, but the user limit the return size to 10, will this parameter trigger?

@polyfractal
Copy link
Contributor

@saiergong the max_buckets parameter limits the maximum number of buckets at both a shard-level and a coordinatator-level. E.g. assuming max_buckets is set to 10,000:

  • If a shard generates more than 10,000 buckets during the course of processing the shard, the limit is triggered and an exception is thrown
  • If five shards all generate 9,999 buckets, they each individually are under the threshold. The per-shard results are sent to the coordinator. Assuming each shard had unique buckets which didn't exist on other shards, as soon as the coordinator starts merging the results the threshold will be breached and an exception is thrown
  • If five shards all generate 9,999 buckets and send those to the coordinator, but all 9,999 buckets are identical across all shards (meaning the total number of buckets generated globally is still 9,999), the threshold isn't breached and no exception is thrown.

Basically, if at any point Elasticsearch finds that there are more than max_buckets number of buckets sitting around, the exception is thrown.

Each agg handles bucketing a little differently. E.g. terms agg has a size parameter, but also a shard_size parameter. Those will affect how many buckets a shard tries to collect. histo/date_histo will collect all the buckets in a range, etc. Some aggs like rare_terms can generate many shard-level buckets but once merged on the coordinator it drops down to a small handful, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants