Skip to content

common/options: Change HDD OSD shard configuration defaults for mClock - #58509

Merged
sseshasa merged 1 commit into
ceph:mainfrom
sseshasa:wip-hdd-osd-shard-params-for-mclock
Sep 25, 2024
Merged

sseshasa merged 1 commit into
ceph:mainfrom
sseshasa:wip-hdd-osd-shard-params-for-mclock

Conversation

@sseshasa

@sseshasa sseshasa commented Jul 10, 2024 •

Copy link
Copy Markdown
Contributor

Based on tests performed at scale on a HDD based cluster, it was found that scheduling with mClock was not optimal with multiple OSD shards. For e.g., in the scaled cluster with multiple OSD node failures, the client throughput was found to be inconsistent across test runs coupled with multiple reported slow requests.

However, the same test with a single OSD shard and with multiple worker threads yielded significantly better results in terms of consistency of client and recovery throughput across multiple test runs.

For more details see https://tracker.ceph.com/issues/66289.

Therefore, as an interim measure until the issue with multiple OSD shards (or multiple mClock queues per OSD) is investigated and fixed, the following change to the default HDD OSD shard configuration is made:

  • osd_op_num_shards_hdd = 1 (was 5)
  • osd_op_num_threads_per_shard_hdd = 5 (was 1)

The other changes in this commit include:

  • Doc change to the OSD and mClock config reference describing this change.
  • OSD troubleshooting entry on the procedure to change the shard configuration for clusters affected by this issue running on older releases.

Fixes: https://tracker.ceph.com/issues/66289
Signed-off-by: Sridhar Seshasayee [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
    • 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

@anthonyeleven

anthonyeleven commented Jul 10, 2024 via email

Copy link
Copy Markdown
Contributor

@sseshasa
sseshasa force-pushed the wip-hdd-osd-shard-params-for-mclock branch 2 times, most recently from ffd9b60 to dd3cad5 Compare July 11, 2024 07:48
@sseshasa

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@markhpc markhpc left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Heya,

So we've known for some time that there are trade-offs between having more or less threads per shard and more or less shards. This may be the right trade-off, but I'd like to understand what we are seeing here a bit better and an explanation regarding the behavior. Specifically, I'd like to see what happens to throughput and latency in non-recovery scenarios and low-load scenarios with the changes and at the very least a description of the test environment. I'm temporarily requesting changes here, but I want to be clear that I don't necessarily disagree with these changes. They are somewhat in-line with what I was looking at doing on the NVMe side in #51949

@sseshasa

sseshasa commented Jul 12, 2024 •

Copy link
Copy Markdown
Contributor Author

Heya,

So we've known for some time that there are trade-offs between having more or less threads per shard and more or less shards. This may be the right trade-off, but I'd like to understand what we are seeing here a bit better and an explanation regarding the behavior. Specifically, I'd like to see what happens to throughput and latency in non-recovery scenarios and low-load scenarios with the changes and at the very least a description of the test environment. I'm temporarily requesting changes here, but I want to be clear that I don't necessarily disagree with these changes. They are somewhat in-line with what I was looking at doing on the NVMe side in #51949

Hi @markhpc ,
The associated tracker (https://tracker.ceph.com/issues/66289) has the context to explain the issue and the reason for this change to the HDD shard configuration.

  • Note-4 describes the issue.
  • Note-16 describes the tests performed and which test had the most favorable outcome.
  • With respect to the throughput and latency in non-recovery scenario, results of phase 1 (row marked hybrid noFailure) in the tables within the above tracker notes do provided some data around this.

But I agree that a more consolidated report of the issue and the eventual solution needs to be included here and I can put that together in this PR. In the meantime please go through the above mentioned tracker notes to see if it gives you some if not all the information. Thanks!

@ljflores

Copy link
Copy Markdown
Member

jenkins retest this please

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@sseshasa
sseshasa force-pushed the wip-hdd-osd-shard-params-for-mclock branch from dd3cad5 to 5882362 Compare July 24, 2024 11:25
@sseshasa

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@sseshasa

Copy link
Copy Markdown
Contributor Author

jenkins test api

@sseshasa

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@ljflores

Copy link
Copy Markdown
Member

jenkins test api

1 similar comment
@sseshasa

Copy link
Copy Markdown
Contributor Author

jenkins test api

@markhpc

markhpc commented Aug 1, 2024

Copy link
Copy Markdown
Member

@sseshasa Heya, just wanted to ask if you've gotten a chance to do any additional testing? I did look through the existing results, but I'd like to really make sure we're not seeing any regressions with these changes. Just wanted to mention I'm still checking in on this regularly and don't want to block it if we're seeing universal wins here.

@sseshasa

sseshasa commented Aug 1, 2024

Copy link
Copy Markdown
Contributor Author

@sseshasa Heya, just wanted to ask if you've gotten a chance to do any additional testing? I did look through the existing results, but I'd like to really make sure we're not seeing any regressions with these changes. Just wanted to mention I'm still checking in on this regularly and don't want to block it if we're seeing universal wins here.

@markhpc We are going to publish the tests we performed and results we observed in a single coherent document soon in the next day or two. That should answer most of the questions. The tests mostly were focused on running the following RGW workloads:

  • Cluster fill
  • Hybrid workloads ranging from 1 hr - 24 hrs
  • OSD failures during the hybrid workloads as noted in the associated tracker.

Results to follow soon.

@sseshasa

sseshasa commented Aug 7, 2024 •

Copy link
Copy Markdown
Contributor Author

@markhpc Here's the gist (thanks @ljflores) that describes the tests performed and results observed: Test Results. Please take a look.

@sseshasa

sseshasa commented Aug 7, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@markhpc

markhpc commented Aug 8, 2024 •

Copy link
Copy Markdown
Member

@markhpc Here's the gist (thanks @ljflores) that describes the tests performed and results observed: Test Results. Please take a look.

Thanks, I just reviewed the document. What I'm looking for are results that clearly show the current defaults vs the 1 shard, 5 threads per shard configuration with both throughput and latency focused tests. Specifically I want to make sure that we don't see any overhead when dealing with a single shard's queue (and perhaps eliminate some other sources of overhead). I'm more interested in the behavior of the change than raw numbers.

@sseshasa

sseshasa commented Aug 8, 2024

Copy link
Copy Markdown
Contributor Author

Thanks, I just reviewed the document. What I'm looking for are results that clearly show the current defaults vs the 1 shard, 5 threads per shard configuration with both throughput and latency focused tests. Specifically I want to make sure that we don't see any overhead when dealing with a single shard's queue (and perhaps eliminate some other sources of overhead). I'm more interested in the behavior of the change than raw numbers.

I should mention it here since it's not clear in the doc that section https://gist.github.com/ljflores/4fbfa479cb2f01e4f23e8dbb9f413f50#throughput-and-response-time-reef-vs-squid shows the difference between Reef and Squid. Reef tests were performed with the current default shard configuration (5 shards and 1 thread per shard). Squid tests used the new proposed configuration (1 shard and 5 threads per shard).

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@markhpc

markhpc commented Aug 15, 2024

Copy link
Copy Markdown
Member

@sseshasa Heya, just realized I owe you some feedback for testing here. Sorry for the delay!

Here's what I'm thinking:

The tests should only have the thread/shard changes and not any others (ie no other code or setting changes). We want as close to a real apples-apples comparison as possible. Preferably also tested at the same level of cluster aging, though I understand this can be difficult if you haven't specifically built your tests for it. I'm fine with it being latest reef or squid, just make sure we only change the thread/shard count.

A repeat of one or more of the RGW tests is fine. We should also get some basic RBD tests in for 4MB and 4KB random reads/writes. Potentially mixed workloads ala the kind of tests that @aclamk has done in the past. Anything that potentially could cause shard level contention. If there are specific tests that would showcase the desirable effect in the mclock scheduler that we would like to highlight that's of course in-scope as well.

Hope that helps!

@sseshasa

Copy link
Copy Markdown
Contributor Author

@sseshasa Heya, just realized I owe you some feedback for testing here. Sorry for the delay!

Here's what I'm thinking:

The tests should only have the thread/shard changes and not any others (ie no other code or setting changes). We want as close to a real apples-apples comparison as possible. Preferably also tested at the same level of cluster aging, though I understand this can be difficult if you haven't specifically built your tests for it. I'm fine with it being latest reef or squid, just make sure we only change the thread/shard count.

A repeat of one or more of the RGW tests is fine. We should also get some basic RBD tests in for 4MB and 4KB random reads/writes. Potentially mixed workloads ala the kind of tests that @aclamk has done in the past. Anything that potentially could cause shard level contention. If there are specific tests that would showcase the desirable effect in the mclock scheduler that we would like to highlight that's of course in-scope as well.

Hope that helps!

@markhpc Thanks for the inputs. It certainly helps focusing on the type of tests to perform. I will work with the team to run these tests and get back with the results.

Based on tests performed at scale on a HDD based cluster, it was found
that scheduling with mClock was not optimal with multiple OSD shards. For
e.g., in the scaled cluster with multiple OSD node failures, the client
throughput was found to be inconsistent across test runs coupled with
multiple reported slow requests.

However, the same test with a single OSD shard and with multiple worker
threads yielded significantly better results in terms of consistency of
client and recovery throughput across multiple test runs.

For more details see https://tracker.ceph.com/issues/66289.

Therefore, as an interim measure until the issue with multiple OSD shards
(or multiple mClock queues per OSD) is investigated and fixed, the
following change to the default HDD OSD shard configuration is made:

 - osd_op_num_shards_hdd = 1 (was 5)
 - osd_op_num_threads_per_shard_hdd = 5 (was 1)

The other changes in this commit include:
 - Doc change to the OSD and mClock config reference describing
   this change.
 - OSD troubleshooting entry on the procedure to change the shard
   configuration for clusters affected by this issue running on older
   releases.
 - Add release note for this change.

Fixes: https://tracker.ceph.com/issues/66289
Signed-off-by: Sridhar Seshasayee <[email protected]>

# Conflicts:
#	doc/rados/troubleshooting/troubleshooting-osd.rst
@sseshasa
sseshasa force-pushed the wip-hdd-osd-shard-params-for-mclock branch from 5882362 to 0d81e72 Compare September 3, 2024 05:40
@sseshasa

sseshasa commented Sep 3, 2024 •

Copy link
Copy Markdown
Contributor Author

@markhpc Thanks for the inputs. It certainly helps focusing on the type of tests to perform. I will work with the team to run these tests and get back with the results.

@markhpc The tests took some time to execute and analyze. Since the scaled cluster was unavailable, I ran the requested throughput and latency focused tests on a single node with multiple HDD based OSDs. The changes were tested on Squid 19.1.1 and the results show no regressions in the throughput tests and significant improvements in the tail latency across all the tests performed. I ran the throughput and latency tests with both replicated and EC backends. I also ran multiple recovery tests similar to the tests run by the IBM performance team to highlight the differences observed between the OSD shard configurations. Please take a look.

Here's the document.
mclock_hdd_osd_shard_config_testing.pdf

@sseshasa

sseshasa commented Sep 3, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test API

@sseshasa

sseshasa commented Sep 3, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test api

@markhpc
markhpc self-requested a review September 5, 2024 14:33

@markhpc markhpc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@sseshasa Thank you for doing these! Ok, based on this testing, it looks like the big win is in tail latency as you said (and it's pretty significant in some of these tests). I really appreciate the work you put into doing this. Thanks for making Ceph better!

@markhpc

markhpc commented Sep 5, 2024 •

Copy link
Copy Markdown
Member

On a side note: We should dig into the sharding behavior and understand this tail latency effect. We know that there is contention with multiple shards on flash based devices as well, but they are overshadowed by the increased parallelism we get. Sam and I talked about potentailly rewriting the sharding code after deciding not pursue the ideas here: #51949. There's definitely room for improvement.

@sseshasa

sseshasa commented Sep 5, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@amathuria

Copy link
Copy Markdown
Contributor

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.

7 participants