8000 add 'balance --max-moves-per-osd' option by janveverka · Pull Request #58 · TheJJ/ceph-balancer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add 'balance --max-moves-per-osd' option #58

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janveverka
Copy link
Contributor

Adds the option --max-moves-per-osd=N to the balance command:

  --max-moves-per-osd MAX_MOVES_PER_OSD
                        only consider moves between OSDs with fewer movements
                        than the given maximum. This includes movements that are
                        both ongoing and planned. It applies to the movement
                        source OSDs as well as the destination ones.

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.

Copy link
Owner
@TheJJ TheJJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@janveverka
Copy link
Contributor Author

@TheJJ , thanks for the feedback! I'll look into optimizing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0