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

thanos store sharding memory issue #1664

Closed
R4scal opened this issue Oct 18, 2019 · 12 comments · Fixed by #1669
Closed

thanos store sharding memory issue #1664

R4scal opened this issue Oct 18, 2019 · 12 comments · Fixed by #1669

Comments

@R4scal
Copy link

R4scal commented Oct 18, 2019

thanos, version 0.8.1 (branch: HEAD, revision: bd8278859b2321aaaa7514edde764816cc039d34)
  build user:       root@2227d9a2fdb1
  build date:       20191014-12:03:55
  go version:       go1.13.1

Object Storage Provider: minio

What happened:
I have multiple prometheus instances in single s3-bucket with different external labels service.
When I tried use --selector.relabel-config for sharding, but all my shards use some memory (as previously all-in-one store instance). So, because all shards have all-in-one memory, sharding not working now.

My configs:
3 prometheus witth external labels:
service: one
service: two
service: another

2 shards with configs:

 - source_labels: [service]
      separator: ;
      regex: one
      replacement: $1
      action: keep
 - source_labels: [service]
      separator: ;
      regex: not_exists
      replacement: $1
      action: keep

I specifically use a nonexistent label for the experiment. I this setup all my shards use around 10Gb Ram (not_exists too).

In thanos query ui i see:

  • one: true labels and time range
  • not_exists: no labels and time range beetween 292278994-08-17T07:12:55Z

In s3 logs i see that thanos get for blacklisted block all: index, index.cache.json, meta.json for all shards.

What you expected to happen:
Sharding with --selector.relabel-config requere memory as need for only shard blocks

@R4scal
Copy link
Author

R4scal commented Oct 18, 2019

Additionally, since index.cache.json is not saved to disk for blacklisted blocks, it is downloaded from s3 each time a bucket is checked, and for some blocks it takes really big

@jojohappy
Copy link
Member

@R4scal Is your first store memory usage in expectation?

@R4scal
Copy link
Author

R4scal commented Oct 18, 2019

@jojohappy yes

@R4scal
Copy link
Author

R4scal commented Oct 18, 2019

In addition, attach CPU and memory on a non-existent shard
Screenshot 2019-10-18 at 16 59 22

@bwplotka
Copy link
Member

bwplotka commented Oct 18, 2019

This looks wrong, we are looking in this, thanks for reporting 👍 ~

@bwplotka
Copy link
Member

Found the problem, fixing now

@bwplotka bwplotka self-assigned this Oct 18, 2019
bwplotka added a commit that referenced this issue Oct 18, 2019
bwplotka added a commit that referenced this issue Oct 18, 2019
bwplotka added a commit that referenced this issue Oct 21, 2019
bwplotka added a commit that referenced this issue Oct 21, 2019
bwplotka added a commit that referenced this issue Oct 22, 2019
…sharding e2e test. (#1669)

* store: Filter blocks before loading it. Sort advertise labels; Added sharding e2e test.

Fixes: #1664

Signed-off-by: Bartek Plotka <[email protected]>

* Trying to speed up tests a bit.

Signed-off-by: Bartek Plotka <[email protected]>

* Fixed tests.

Signed-off-by: Bartek Plotka <[email protected]>
@bwplotka
Copy link
Member

This should be fixed, can you verify? E.g by using master image: master-2019-10-22-64af185e from https://quay.io/repository/thanos/thanos?tag=latest&tab=tags

@R4scal
Copy link
Author

R4scal commented Oct 23, 2019

Yep, I will try and reply today

@R4scal
Copy link
Author

R4scal commented Oct 23, 2019

@bwplotka looks amazing
Screenshot 2019-10-23 at 17 37 37

@bwplotka
Copy link
Member

Awesome!

I think we internally agreed to not release v0.8.2 unless necessary as sharding is experimental. We want to release this in v0.9.0 around 20thNov.

Is that fine?

cc @jojohappy

@jojohappy
Copy link
Member

I think we internally agreed to not release v0.8.2 unless necessary as sharding is experimental. We want to release this in v0.9.0 around 20thNov.

Agree.

@R4scal
Copy link
Author

R4scal commented Oct 24, 2019

Ok, thanks

GiedriusS pushed a commit that referenced this issue Oct 28, 2019
…sharding e2e test. (#1669)

* store: Filter blocks before loading it. Sort advertise labels; Added sharding e2e test.

Fixes: #1664

Signed-off-by: Bartek Plotka <[email protected]>

* Trying to speed up tests a bit.

Signed-off-by: Bartek Plotka <[email protected]>

* Fixed tests.

Signed-off-by: Bartek Plotka <[email protected]>
Signed-off-by: Giedrius Statkevičius <[email protected]>
brancz pushed a commit to brancz/objstore that referenced this issue Jan 28, 2022
…sharding e2e test. (#1669)

* store: Filter blocks before loading it. Sort advertise labels; Added sharding e2e test.

Fixes: thanos-io/thanos#1664

Signed-off-by: Bartek Plotka <[email protected]>

* Trying to speed up tests a bit.

Signed-off-by: Bartek Plotka <[email protected]>

* Fixed tests.

Signed-off-by: Bartek Plotka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants