add 'balance --max-moves-per-osd' option#58
Conversation
There was a problem hiding this comment.
hey! great idea, this surely is useful.
i think the implementation can be optimized a bit :)
your code basically does explicit tracking, but this for example disregards movements that are un-done in the process. this also is something that changes during optimization, so it should be part of the simulated cluster state PGMappings.
so it would be better to add the query of planned OSD moves as a feature/new function to PGMappings.
the number of planned moves is simply
@lru_cache(max=...)
def get_osd_remaps_num(self, osdid: int):
return len(self._osd_pgs_up[osdid] ^ self._osd_pgs_acting[osdid])that can be returned from a cached function (which is cache-reset when a new move is recorded).
|
@TheJJ , thanks for the feedback! I'll look into optimizing it. |
|
did you have a chance to look at this again? :) |
|
Not yet, sorry. It's still on my radar though. :-) |
Adds the option
--max-moves-per-osd=Nto thebalancecommand:Using this option ensures that the found movements would not cause the number of simultaneously ongoing moves per OSD to be greater than the given
MAX_MOVES_PER_OSD.This helps with making the movements more spread out across the cluster and avoiding overload of some OSDs to a point that it negatively affects clients. This may be useful on some heavily loaded mission critical clusters, especially when running on spinning drives.