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

Search Responses to Many Shards use Excessive Amounts of Memory for OriginalIndices instances #78314

Closed
Tracked by #77466
original-brownbear opened this issue Sep 27, 2021 · 2 comments
Labels
>bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team

Comments

@original-brownbear
Copy link
Member

Running a simple/fast search on a large number of indices via an index pattern can result in significant memory usage on the coordinating node for the org.elasticsearch.action.OriginalIndices instances in the search responses.

When using a simple pattern of e.g. auditbeat-${long} and searching over 1k indices, this leads to hundreds of MB (and more during heavy load) of duplicate instances on heap that are referenced as such:

image

I think it should be possible to deduplicate these (or even the full search requests referenced in the responses?).
This somewhat relates to #78164 but doesn't just apply to can_match.
The problem with these instances is that they are not accounted for all that well by the circuit breaker in the response collector and it's trivial to OOM a coordinating node if a search targets a large number of indices at once when the responses come back rapidly.

@original-brownbear original-brownbear added >bug :Search/Search Search-related issues that do not fall into other categories needs:triage Requires assignment of a team area label labels Sep 27, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Sep 27, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@romseygeek romseygeek removed the needs:triage Requires assignment of a team area label label Oct 1, 2021
jimczi added a commit that referenced this issue Oct 14, 2021
Today the search action send the full list of original indices on every shard request.
This change restricts the list to the concrete index of the shard or the alias that was used to resolve it.

Relates #78314
jimczi added a commit that referenced this issue Oct 14, 2021
Today the search action send the full list of original indices on every shard request.
This change restricts the list to the concrete index of the shard or the alias that was used to resolve it.

Relates #78314
@jimczi
Copy link
Contributor

jimczi commented Oct 20, 2021

Fixed by #78508

@jimczi jimczi closed this as completed Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

No branches or pull requests

4 participants