-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
store/compact: bucket fetch is broken in v0.32 vs v0.31 #6707
Comments
We see the same with our large bucket: 0.32.2: We suspect the changes in #6474, as using a single threaded |
I wonder if we can Iter one level deep instead of over all chunks. |
@gburek-fastly Which object store provider do use? The reason for doing a recursive iter was to reduce costs, and I am also curious if you see a reduction in daily spend for API operations. |
We use GCS as an object store. We have not seen a reduction in daily spend, though, as we have not deployed 0.32.x to production. This regression was discovered in a canary and it wouldn't be great to have long term searches be unavailable for 20m or more as store-gateways recover from OOMs or other failures. TBF we previously controlled costs a bit by raising |
There is no cost reduction in v0.32 for GCS because from bucket perspective request rate reduces 10%, but bandwidth increases 10x. Also, compactor cannot process its queue anymore, as it becomes slower x3 or more. |
I will try out a version with thanos-io/objstore#76 to see if it helps. |
I've tried image
but unfortunately it continues to consume cpu/network. Here is 3 lines for thanos-store |
With
24m48 for 38105 blocks |
What seems not normal in v0.32 is the constant incoming network traffic for thanos-store. It is 2Mbit/s after it is
Also tried sysdig, but cant dump request body there:
|
We attempted to upgrade our compact nodes to compact cli args: logs
For us, with our block and data load Compact and store are unusable without a cli arg to enable the Exists strategy when listing all objects in the bucket takes 20 to 45 minutes for GCS. I am happy to run debug builds, add logging, generate trace spans or whatever, to show this. |
@fpetkovski you mentioned above:
How many objects are in this bucket that make up 155k blocks? What is the backing object store? |
Here is easier way to reproduce the issue:
And new version never finishes (same 5m timeout each time):
|
I wonder how we could reproduce this locally ourselves 🤔 |
I think this is a result of the fact that recursive iter is simply slower, and I don't know if we have a good way to fix it. I am fine with reverting the change, but if others have seen benefits, we could maybe make it optional? |
By adding a few fmt.Println I was able to find out the reason.
|
Thanks for reporting back @sepich, I am glad this was resolved for you. |
@gburek-fastly sorry just seeing this. We use GCS, but I am not sure what is the total object count. Does the solution from @sepich resolve your problem? |
We got the same issue I think and cleaning up objects (especially those versioned objects) in the S3 bucket helps in our case. |
After #6902 is merged, I wonder how we should proceed with improving this. |
We reduced our daily object storage bill by thousands of dollars per day by using a recursive iterator, so having no escape hatch will put us in a very bad spot. I would say the root cause is the large amount of partial blocks in object storage, or data unrelated to Thanos. For the versioned objects use case, we should probably change the library to only request the latest version. I am also fine with having both methods as options since there are obvious trade-offs. We still haven't heard from @gburek-fastly whether his issue falls into one of these two categories. |
Thank you for the tip wrt the debug meta.jsons. There were a lot of these. We have removed 4e6 debug objects, which has improved our bucket sync times from 24m to 12m. 0.32.3: This is still, unfortunately, several orders of magnitude worse than 0.31.0, which is at 2s: Our 38K blocks, without the debug metas, are comprised of 4.98e6 objects and we see a linear relationship between start up times and total bucket obj count. As far as I can tell, we see around 10-75 For context, we use GCS and have versioned objects. I think making the fetch method configurable is probably the way to go, as we effectively have two extremes of operation:
The efficiency of using iter may be primarily dictated by density of meta.json objects in the bucket. It will of course be expensive to continually HEAD hundreds of thousands meta.json objects, but in our case, where meta.json objects are barely 1% of the objects in the bucket, the time to list all objects is prohibitive vs the cost to HEAD a few objects. I think this should be configurable, at least, to allow for our different data environments and give a choice between cost/start up times. |
Hello, Startup times of the store component increased from 2-3 seconds to ~40 minutes after the upgrade to v0.32.5. Deleting Runtime of the compact component also increased from ~03h20m to ~05h15m. We have not observed any significant increase or decrease in costs of our S3 bucket. Being able to switch back to the old fetch logic would allow us to upgrade to v0.32.x and newer. |
We are in the same situation as people above. Our storegateway startup time increased from a few minutes to more than 1h for large S3 buckets and thus we are stuck on 0.31. |
What storage providers are you using? AWS S3 or some other implementation? |
AWS S3 for us |
Is there any chance of getting traction on this to expose the old bucket sync method in some way? |
I am already on it #7134 |
Thanos, Prometheus and Golang version used:
v0.32.2
Object Storage Provider: GCS
What happened:
Tried to upgrade from v0.31.0 to v0.32.2 and seeing for both
compactor
andstore
:Ready
time to 20min (from 1min for v0.31.0):store
container towards bucket, even after sync of blocks is completed, it isReady
, and there are no query requests comingUsing images available on docker hub the issue is narrowed down to:
thanosio/thanos:main-2023-07-03-9710935
- okthanosio/thanos:main-2023-07-03-b60452a
- badSo it is https://github.com/thanos-io/thanos/pull/6474/files to blame
cc @fpetkovski
Also attaching pprof cpu profile for 60s, when
store
becomesready
and there is no any queries to it:Archive.zip
What you expected to happen:
New version is better than previous ;)
How to reproduce it (as minimally and precisely as possible):
Full logs to relevant components:
No any errors in logs, just very slow timings
The text was updated successfully, but these errors were encountered: