Skip to content

mgr/balancer: optimize 'balancer status detail'#60523

Merged
ljflores merged 3 commits intoceph:mainfrom
ljflores:wip-tracker-68657
Nov 21, 2024
Merged

mgr/balancer: optimize 'balancer status detail'#60523
ljflores merged 3 commits intoceph:mainfrom
ljflores:wip-tracker-68657

Conversation

@ljflores
Copy link
Member

@ljflores ljflores commented Oct 28, 2024

Before, we were updating the balancer status by
iterating through all pg upmap entires. This was
affecting the loading time of other mgr modules
on clusters with a large number of pgs (600+).

This can be optimized by simply pulling from
the incremental.

Fixes: https://tracker.ceph.com/issues/68657

This PR also ties "ceph balancer status detail"
to a configurable. To test out the configurable,
you can run ceph config set mgr mgr/balancer/update_pg_upmap_activity <True|False>.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

Laura Flores added 3 commits November 1, 2024 22:50
Before, we were updating the balancer status by
iterating through all pg upmap entires. This was
affecting the loading time of other mgr modules
on clusters with a large number of pgs (600+).

This can be optimized by simply pulling from
the incremental.

Fixes: https://tracker.ceph.com/issues/68657
Signed-off-by: Laura Flores <lflores@ibm.com>
This addition gives users the option of enabling/disabling this feature.

They can do so by running:
ceph config set mgr mgr/balancer/update_pg_upmap_activity <True|False>

The feature is off by default.

Signed-off-by: Laura Flores <lflores@ibm.com>
Signed-off-by: Laura Flores <lflores@ibm.com>
@ljflores
Copy link
Member Author

ljflores commented Nov 4, 2024

jenkins test api

@ljflores
Copy link
Member Author

ljflores commented Nov 4, 2024

jenkins test make check

@ljflores
Copy link
Member Author

ljflores commented Nov 5, 2024

jenkins test make check arm64

Copy link
Contributor

@rzarzynski rzarzynski left a comment

Choose a reason for hiding this comment

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

LGTM!

self.pg_upmap_items_added = [pg for pg in osdmap.dump().get('pg_upmap_items', '') if pg not in self.last_pg_upmap]
self.pg_upmap_items_removed = [pg for pg in self.last_pg_upmap if pg not in osdmap.dump().get('pg_upmap_items', '')]
self.last_pg_upmap = osdmap.dump().get('pg_upmap_items', '')
self.pg_upmap_items_added = incdump.get('new_pg_upmap_items', [])
Copy link
Contributor

Choose a reason for hiding this comment

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

ACK.

r, detail = self.execute(plan_)
self.update_pg_upmap_activity(plan_) # update pg activity in `balancer status detail`
pg_upmap_activity = cast(bool, self.get_module_option('update_pg_upmap_activity'))
if pg_upmap_activity:
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this commit alone would be enough to pacify the issue...
Do we have a plan ti re-enable the command (by default)?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a new feature in Squid, so I think it makes sense to disable it for now until testing can confirm that it can handle scalability. Then, we can enable it by default.

@rzarzynski rzarzynski added needs-qa and removed needs-squid-backport PR needs a squid backport labels Nov 13, 2024
@ljflores
Copy link
Member Author

@ljflores ljflores merged commit 5174b1f into ceph:main Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants