Elastic Search - Scrolling for Not too many documents?

We have a use-case where we are querying elastic for an unknown number of results, with very aggressive latency requirements.
In 99 percentile of scenarios, the result-set < page size. In <= 1 percentile, the results may be > page size. Since we need to return all results in one go, without pagination, does it make sense to use scrolling for all requests, even though it will be used very rarely? Or does it make sense for < 1 percentile scenarios, to make subsequent standalone requests to collect all the results before returning the result set?

Is there any initial overhead to initiating a scroll session?

I see the documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html mentions Scrolling is not intended for real time user requests, but rather for processing large amounts of data, e.g. in order to reindex the contents of one index into a new index with a different configuration. But in general will the performance be detrimental if scrolling-sessions are initiated for all requests?

Not really a performance thing but more about locking some files on the filesystem IMO plus the memory needed to hold all scrolls.

At least you should clear the scroll or use a very small timeout like some seconds may be?

Never did that though.

1 Like

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