Skip to content

rgw: supports lc aio using coroutines - #63678

Closed
matt-akamai wants to merge 1 commit into
ceph:mainfrom
matt-akamai:lc_processing_using_coroutines
Closed

matt-akamai wants to merge 1 commit into
ceph:mainfrom
matt-akamai:lc_processing_using_coroutines

Conversation

@matt-akamai

Copy link
Copy Markdown

We are upstreaming a change we worked on in-house to modify the lc processing to use co-routintes. A new configuration parameter rgw_lc_wp_worker_max_aio is introduced to change this behavior, by default the value is set to 1 to keep current behavior.

In our tests, we've seen the max RPS on LC processing double in performance.

Signed-off-by: Matthew H [email protected]

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
    • [X ] 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

@matt-akamai
matt-akamai requested a review from a team as a code owner June 3, 2025 17:22
@mattbenjamin

Copy link
Copy Markdown
Contributor

so this gets double the performance at some fixed set of values for lc_max_worker and lc_max_wp_worker? or is it twice as fast as, e.g., setting lc_max_wp_worker to 2x an original value? @cbodley and I think that the worker queue model probably scales fine up to many more than 3 x 3 workers--we observe it in testing. that said, @cbodley and I are both interested in eventually transitioning to a pure coroutine based model. what would you think about that?

@github-actions

github-actions Bot commented Jun 5, 2025

Copy link
Copy Markdown

Config Diff Tool Output

+ added: rgw_lc_wp_worker_max_aio
- removed: breakpad

The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.

Comment thread src/rgw/rgw_lc.cc
Comment on lines +831 to +832
boost::asio::io_context context;
for(auto& item : items) {

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.

shouldn't access to items be protected with the mutex?

it doesn't look like rgw_lc_wp_worker_max_aio is taking effect here. this just spawns a coroutine for every item

based on your changes to dequeue(), i'm guessing you intended to do something like this?

auto my_items = dequeue(rgw_lc_wp_worker_max_aio);
for (auto& item : my_items)

@cbodley

cbodley commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

@matt-akamai thanks for joining the performance call to discuss this!

i really like this use of coroutines for concurrent object processing, but the lifecycle design already uses threads for that concurrency. i'd really like to see coroutines replace those WorkPool threads, instead

we've been adopting coroutines elsewhere, and made a ceph::async::spawn_throttle that i think fits this pattern very well. in exploring this design to describe it here, i found that it was easier to type up a draft: #63762. this just puts a spawn_throttle on the stack of RGWLC::bucket_lc_process() and runs the coroutines there, without the need for WorkPool threads

@matt-akamai

Copy link
Copy Markdown
Author

Closing in favor of #63762

@cbodley

cbodley commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

Closing in favor of #63762

#63762 finally merged, sorry for all the delays from qa. thanks again for the contribution and help with testing

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.

5 participants