Skip to content

src/osd: OSDShard adaptive threading and double buffering - #51949

Closed
markhpc wants to merge 4 commits into
ceph:mainfrom
markhpc:wip-osd-threading
Closed

markhpc wants to merge 4 commits into
ceph:mainfrom
markhpc:wip-osd-threading

Conversation

@markhpc

@markhpc markhpc commented Jun 7, 2023 •

Copy link
Copy Markdown
Member

More details to come. Basic idea: We only wake up threads when the scheduler (or now double buffer) queue grows large. We only let them go to sleep when the queue gets small (governed by the per-shard thread id) We try to avoid contention on the shard lock and wait lock. We try to avoid notify spam by having per-thread condition variables and wait locks. In single OSD tests this has shown only minor improvement, however in multi-OSD tests with lots of per-node resource contention (8 NVMe, 3X rep, 1 Officinalis node) the results are fairly dramatic. These tests are with 3 shards, 8 threads each, 1 msgr thread vs main defaults:

test main wip-osd-threading
4krandread iops 345K 480K
4krandread cycles/op 399K 266K
4krandwrite iops 65.7K 83.8K
4krandwrite cycles/op 2.90M 1.88M

Most of the focus now is on async messenger threading behavior and OSD interaction. We still want multiple messenger threads in some cases but we need to change their behavior to achieve good cycles/op numbers going forward. That, combined with on-going work inside bluestore to approve effiency should yield some nice gains.

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

@markhpc
markhpc requested a review from a team as a code owner June 7, 2023 06:05
@github-actions github-actions Bot added the core label Jun 7, 2023
@markhpc markhpc changed the title [WIP] src/osd: OSDShard Adaptive Threading and double buffering [WIP] src/osd: OSDShard adaptive threading and double buffering Jun 7, 2023
@markhpc

markhpc commented Jun 7, 2023

Copy link
Copy Markdown
Member Author

FYI, the mclock queue size isn't working properly right now, but wpq does work.

@markhpc markhpc added the DNM label Jun 7, 2023
@markhpc
markhpc force-pushed the wip-osd-threading branch from d59f966 to 748ba46 Compare June 8, 2023 20:15
Mark Nelson added 2 commits June 9, 2023 01:01
@markhpc
markhpc force-pushed the wip-osd-threading branch from 748ba46 to 98efbe9 Compare June 9, 2023 01:28
@markhpc

markhpc commented Jun 9, 2023

Copy link
Copy Markdown
Member Author

mclock now appears to work properly.

@markhpc markhpc changed the title [WIP] src/osd: OSDShard adaptive threading and double buffering src/osd: OSDShard adaptive threading and double buffering Jun 13, 2023
@markhpc

markhpc commented Jun 13, 2023 •

Copy link
Copy Markdown
Member Author
94% tests passed, 15 tests failed out of 231

Total Test time (real) = 4108.15 sec

The following tests FAILED:
	  4 - run-tox-mgr (Failed)
	  5 - setup-venv-for-mgr-dashboard-py3 (Failed)
	  7 - run-tox-mgr-dashboard-py3 (Not Run)
	  8 - setup-venv-for-mgr-dashboard-lint (Failed)
	 10 - run-tox-mgr-dashboard-lint (Not Run)
	 11 - setup-venv-for-mgr-dashboard-check (Failed)
	 13 - run-tox-mgr-dashboard-check (Not Run)
	 14 - setup-venv-for-mgr-dashboard-openapi (Failed)
	 16 - run-tox-mgr-dashboard-openapi (Not Run)
	 17 - setup-venv-for-python-common (Failed)
	 19 - run-tox-python-common (Not Run)
	 22 - run-tox-cephadm (Failed)
	162 - unittest_erasure_code_shec_arguments (Failed)
	184 - unittest_deferred (Subprocess aborted)
	231 - run-tox-qa (Failed)

Same test failures in the parent commit from main, so I think they are unrelated to this PR.

@markhpc

markhpc commented Jun 13, 2023

Copy link
Copy Markdown
Member Author

retest this please

1 similar comment
@markhpc

markhpc commented Jun 13, 2023

Copy link
Copy Markdown
Member Author

retest this please

@markhpc markhpc removed the DNM label Jun 13, 2023
@markhpc
markhpc force-pushed the wip-osd-threading branch from 7680b33 to d6789d4 Compare June 14, 2023 00:05
@markhpc markhpc added the DNM label Jun 15, 2023
@markhpc

markhpc commented Jun 15, 2023

Copy link
Copy Markdown
Member Author

Setting this back to DNM for the moment. I'm evaluating whether or not it's worth it to let threads spin for a short time before going to sleep for low-load clusters.

@markhpc
markhpc force-pushed the wip-osd-threading branch 3 times, most recently from 7036270 to 7de1da1 Compare June 17, 2023 04:35
@markhpc
markhpc force-pushed the wip-osd-threading branch from 156a328 to 11e967e Compare June 19, 2023 00:55
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Oct 23, 2023
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

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.

1 participant