Skip to content

test/mgr: add fake OSDs for mgr scale testing - #72728

Merged
NitzanMordhai merged 1 commit into
ceph:mainfrom
NitzanMordhai:wip-nitzan-test-mgr-fake-osds
Nov 5, 2026
Merged

NitzanMordhai merged 1 commit into
ceph:mainfrom
NitzanMordhai:wip-nitzan-test-mgr-fake-osds

Conversation

@NitzanMordhai

@NitzanMordhai NitzanMordhai commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

ceph_test_mgr_fake_osd boots into the osdmap like a real OSD (MOSDBoot with bluestore-like metadata, beacons, pg create acks) and reports to the mgr through MgrClient, but has no object store, peering or heartbeats. Each fake reports the PGs it is acting primary for as active+clean, so a vstart cluster can carry hundreds of OSDs and a large pgmap at ~115MB per fake.

fake-osd-cluster.sh starts a 1 mon / 1 mgr vstart cluster, launches the fakes and creates a pool, waiting until all PGs are active+clean. It also works around vstart with OSD=0 creating size 0 pools, which corrupt the mon heap once crush has a device.

Example, from the build dir:

ninja ceph_test_mgr_fake_osd vstart-base
../src/test/mgr/fake-osd-cluster.sh start -o 10 -p 10000 -s 3
../src/test/mgr/fake-osd-cluster.sh add 5
../src/test/mgr/fake-osd-cluster.sh status
../src/test/mgr/fake-osd-cluster.sh stop --all

10 fake OSDs with a 10000 PG pool reach active+clean in about 10s.

Resources measured with 10 fakes and 10000 PGs (debug build):

  • each fake: ~115MB RSS, 14 threads, ~0.3% of one core
  • each fake binds 2 ports from ms_bind_port_min..max (6800-7568 by default), so about 370 fakes per host unless the range is raised
  • the fakes recompute their PG list once per osdmap epoch, so CPU spikes briefly on every map change, growing with PG count

Assisted-by: Claude

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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

ceph_test_mgr_fake_osd boots into the osdmap like a real OSD (MOSDBoot
with bluestore-like metadata, beacons, pg create acks) and reports to
the mgr through MgrClient, but has no object store, peering or
heartbeats. Each fake reports the PGs it is acting primary for as
active+clean, so a vstart cluster can carry hundreds of OSDs and a
large pgmap at ~115MB per fake.

fake-osd-cluster.sh starts a 1 mon / 1 mgr vstart cluster, launches
the fakes and creates a pool, waiting until all PGs are active+clean.
It also works around vstart with OSD=0 creating size 0 pools, which
corrupt the mon heap once crush has a device.

Example, from the build dir:

  ninja ceph_test_mgr_fake_osd vstart-base
  ../src/test/mgr/fake-osd-cluster.sh start -o 10 -p 10000 -s 3
  ../src/test/mgr/fake-osd-cluster.sh add 5
  ../src/test/mgr/fake-osd-cluster.sh status
  ../src/test/mgr/fake-osd-cluster.sh stop --all

10 fake OSDs with a 10000 PG pool reach active+clean in about 10s.

Resources measured with 10 fakes and 10000 PGs (debug build):
- each fake: ~115MB RSS, 14 threads, ~0.3% of one core
- each fake binds 2 ports from ms_bind_port_min..max (6800-7568 by
  default), so about 370 fakes per host unless the range is raised
- the fakes recompute their PG list once per osdmap epoch, so CPU
  spikes briefly on every map change, growing with PG count

Signed-off-by: Nitzan Mordechai <[email protected]>
Assisted-by: Claude

@stzuraski898 stzuraski898 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry for the close/reopen, I meant to delete my comment, which I entered erroneously

I think this'll be very useful, and potentially worth putting higher up in src/test so that other places can make use of the setup. I was experimenting and think I've found a few oddities that are worth fixing

@NitzanMordhai NitzanMordhai mentioned this pull request Nov 4, 2026
4 of 14 tasks
@NitzanMordhai

Copy link
Copy Markdown
Contributor Author

Merging since we its new testing capability, no qa tests touching it

@NitzanMordhai
NitzanMordhai merged commit 06c8e00 into ceph:main Nov 5, 2026
30 of 34 checks passed
@NitzanMordhai
NitzanMordhai deleted the wip-nitzan-test-mgr-fake-osds branch November 5, 2026 14:11
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/42042578610

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.

3 participants