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

Group together search requests that hit the same shard in the search queue #71962

Open
jpountz opened this issue Apr 20, 2021 · 2 comments
Open
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team

Comments

@jpountz
Copy link
Contributor

jpountz commented Apr 20, 2021

On dense tiers like warm and cold the page cache can only cover a tiny fraction of the index, while disk access is expensive as these dense tiers often leverage spinning disks.

Could we reorder items in the search queue in order to group together shard requests that would hit the same shard in order to maximize the hit ratio of the page cache?

This is probably something that we should avoid doing on the content tier where this could trade latency for throughput in non-desirable ways?

@jpountz jpountz added >enhancement :Search/Search Search-related issues that do not fall into other categories labels Apr 20, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Apr 20, 2021
@elasticmachine
Copy link
Collaborator

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

@jpountz
Copy link
Contributor Author

jpountz commented May 20, 2021

One concrete implementation idea to make this work would be to switch the search queue to a PriorityQueue, that would be ordered by the time when the request entered the queue rounded to 10s, then the shard identifier (index UUID + shard number)?

Using the timestamp first helps make sure that some shard requests would not get indefinitely delayed if new shard requests with a lower shard identifier kept coming in. The rounding granularity could possibly depend on the tier, e.g. 10s on warm/cold and 1m on frozen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :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

2 participants