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

Add streaming to Remote Read endpoint #4517

Closed
gouthamve opened this issue Aug 19, 2018 · 12 comments
Closed

Add streaming to Remote Read endpoint #4517

gouthamve opened this issue Aug 19, 2018 · 12 comments

Comments

@gouthamve
Copy link
Member

Remote read is quite inefficient right now and could be made much better through streaming. This has been discussed in the dev-summit: https://docs.google.com/document/d/1-C5PycocOZEVIPrmM1hn8fBelShqtqiAmFptoG4yK70/edit#heading=h.5d2mc4i0bnnp

@bwplotka
Copy link
Member

I can take it if no one started working on this.

Design doc: https://docs.google.com/document/d/1JqrU3NjM9HoGLSTPYOvR217f5HBKBiJTqikEB9UiJL0/edit?usp=sharing

Dev-mailing topic: https://groups.google.com/forum/#!topic/prometheus-developers/79b6j_6F_Vc

@harshal-shah
Copy link

According to #4655 it seems this has been resolved in prometheus 2.5.0

@bwplotka
Copy link
Member

Well, the memory was reduced (not sure how largely), but there still is a need for streamed remote read, potentially with chunk encoding to reduce used memory on query to minium.

@rshivane
Copy link

I would like to add that, as a vendor implementing the server-side of remote read API, the lack of streaming adds similar memory pressure on the marshaling side.

@bwplotka I notice that your already have a PR for streaming support in #4591. Whenever this is approved for merge, we would be happy to implement it on our storage and validate.

@bwplotka
Copy link
Member

Yes. This is working code for streaming with raw samples, but we have some internal discussion how it should be done. I closed it to reduce confusion for now: #4591

TL;DR: It would be nice to have remote read stream with Prometheus chunk encoded samples (instead of row samples), to avoid unnecessary decoding & encoding. Does it
The plan is to:

  1. Change the doc to propose this idea (right now it proposes something in between)
  2. Setup a call to gather feedback on this idea.

Did not have much time to jump into it yet, but I am happy to hear that you are ok to help with this!

@rshivane
Copy link

It would be nice to have remote read stream with Prometheus chunk encoded samples (instead of row samples), to avoid unnecessary decoding & encoding.

Is that essentially "Alternative 1" in the design doc ?

@bwplotka
Copy link
Member

Exactly, but need to reorder ;p

@bwplotka
Copy link
Member

bwplotka commented Jun 7, 2019

Just FYI, since we got concensus on this, expect more finalized design doc (same link: https://docs.google.com/document/d/1JqrU3NjM9HoGLSTPYOvR217f5HBKBiJTqikEB9UiJL0/edit#) and initial benchmarks soon. I scheduled some time for this work in June.

@bwplotka
Copy link
Member

bwplotka commented Jun 21, 2019

Back to business!

Server side changes: #5703
Caller usage example (Thanos): thanos-io/thanos#1268

Living document: https://docs.google.com/document/d/1JqrU3NjM9HoGLSTPYOvR217f5HBKBiJTqikEB9UiJL0/edit#

@bwplotka
Copy link
Member

bwplotka commented Jul 5, 2019

First MVP should be safe to use. I build 2 docker images if someone wants to try:

If you use sidecar, I updated caller side as well:

  • improbable/thanos:v0.5.0-rr-streamed2 with thanos sidecar remote read streaming support.

No config changes, just move docker images to that Prometheus and Thanos sidecar tags and enjoy!

2 big requests against Prometheus + sidecar in upgraded version look like this memory and CPU wise:
image

Versus old one with non-streaming sampled read (3GB of mem!):
image

bwplotka added a commit that referenced this issue Aug 19, 2019
…hunked, checksumed reader (#5703)

Part of: #4517 and thanos-io/thanos#488

Changes:
* Extended protobuf for chunked remote read and negotation.
* Added checksumed, chunked Writer/Reader.
* Added Server side implementation for chunked streamed remote-read.


Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
@bwplotka
Copy link
Member

Remote read now supports streaming.

@bwplotka
Copy link
Member

bwplotka commented Aug 19, 2019

@lock lock bot locked and limited conversation to collaborators Feb 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants