-
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-gateway: add support to lazy mmap index-headers #3431
Store-gateway: add support to lazy mmap index-headers #3431
Conversation
84ab39d
to
e570fd6
Compare
OK @bwplotka. I've manually tested it and, so far, I haven't noticed any issue. I think it's ready for a review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing, generally LGTM, just style/readability things to improve 💪
Thanks!
lazyIndexReaderEnabled := cmd.Flag("store.enable-index-header-lazy-reader", "If true, Store Gateway will lazy memory map index-header only once required by a query."). | ||
Hidden().Default("false").Bool() | ||
|
||
lazyIndexReaderIdleTimeout := cmd.Flag("store.index-header-lazy-reader-idle-timeout", "If index-header lazy reader is enabled and this idle timeout setting is > 0, memory map-ed index-headers will be automatically released after 'idle timeout' inactivity."). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can stay hidden, maybe not sure if needed to be tweaked (less flags = simler to use thing is )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to keep the hidden flag, to allow all of us to experiment with that and find a better idle timeout. I just put a "random" value so far.
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
ad30aab
to
bc167bd
Compare
Signed-off-by: Marco Pracucci <marco@pracucci.com>
@bwplotka Thanks for the review! I've address your comments or commented otherwise. Could you take another look, please? |
Signed-off-by: Marco Pracucci <marco@pracucci.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Experimental lazy index-header reader Signed-off-by: Marco Pracucci <marco@pracucci.com> * Implemented lazy index-header reader Signed-off-by: Marco Pracucci <marco@pracucci.com> * Renamed CLI flags Signed-off-by: Marco Pracucci <marco@pracucci.com> * Added copyright to new files Signed-off-by: Marco Pracucci <marco@pracucci.com> * Track metrics in the lazy index-header reader Signed-off-by: Marco Pracucci <marco@pracucci.com> * Ensure BucketStore.Close() is called in tests Signed-off-by: Marco Pracucci <marco@pracucci.com> * Ensure BucketStore.Close() is called in e2e tests too Signed-off-by: Marco Pracucci <marco@pracucci.com> * Shorten metric names Signed-off-by: Marco Pracucci <marco@pracucci.com> * Added CHANGELOG entry Signed-off-by: Marco Pracucci <marco@pracucci.com> * Addressed review comments Signed-off-by: Marco Pracucci <marco@pracucci.com> * Removed readerTracker Signed-off-by: Marco Pracucci <marco@pracucci.com> * Fixed test and comments Signed-off-by: Marco Pracucci <marco@pracucci.com> Signed-off-by: Oghenebrume50 <raphlbrume@gmail.com>
Changes
As discussed during the Thanos community meeting, I would like to propose to add support for lazy mmaping of index-headers in the store-gateway with the ability to automatically unload them after X time of inactivity. This PR aims to do it.
Draft because:
Verification
Unit tests.