-
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
Use of json.Decoder #1160
Comments
Yea, so there is overall quite large of improvements we can make to Thanos Store #448 I fully agree here with Decoder not being designed for this 👍 But I think all those 3 flaws are either fixed (not draining connections) in Go1.12 or not affecting us really (ignoring errs, "it's not for non stream"), am I wrong? |
If we do consider optimizing json decoding we should probably consider json-iterator. And of course benchmark to validate that it would indeed be better for our use. |
I have been working on this for a while: #1013. Should help with the JSON encoding/decoding part. And I have deliberated a bit on the problems in this issue that you mentioned @miekg as well, and AFAICT @bwplotka is correct in saying that this doesn't affect us since we control the format of the JSON files, and all of the other problems were fixed already. |
[ Quoting <[email protected]> in "Re: [improbable-eng/thanos] Use of ..." ]
I have been working on this for a while: #1013. And I have deliberated a bit on the problems in this issue as well, and AFAICT @bwplotka is correct in saying that this doesn't affect us since we control the format of the JSON files, and all of the other problems were fixed already.
Oh yes, that looks nicer still. How far off are you with this PR?
|
Ok, we've been running a couple of instances with json.Unmarshal instead of Decoder and from eyeballing the memory graphs they look marginally better than the unpatched instance. It doesn't look it's worth pursuing this, esp in light of #1013 and other efforts to look a memory. |
I think we can still do this because the json decoding code will still be in Thanos for some time since the migration path will have to be there. So you can go ahead and do this if it really helps with RAM consumpion IMO, @miekg. |
Ack. We'll upstream what we have @tmhdgsn |
Closing this since #1173 was merged. Thank you! 👍 |
We (also) seeing increased memory use (and still some leaks) in our thanos-store (v 0.4).
json.Decoder jumps out:
Reading this was illuminating: https://ahmet.im/blog/golang-json-decoder-pitfalls/ (although targets older version of Go [1.7]).
We're planning to rip out
json.Decoder
and move everything tojson.Unmarshal
and see how that fares.The text was updated successfully, but these errors were encountered: