loki icon indicating copy to clipboard operation
loki copied to clipboard

Stream responses from Querier to Query Frontend.

Open jeschkies opened this issue 3 years ago • 0 comments

What this PR does / why we need it: The is the result of a time boxed experiment. I wanted to see if we can stream results from the querier to the query frontend without changing the scheduler API too much.

It seems possible. However, right now the benefit is minimal. The JSON ecnoder, jsoniter, does not support stream encoding (https://github.com/json-iterator/go/issues/488). We also buffer before serialization.

Querier to query frontend streaming would enable

  • Partial result streaming.
  • Remote read API without buffering.
  • Less buffering, i.e. fewer allocations and less memory consumption.

jeschkies avatar Jul 25 '22 13:07 jeschkies