Skip to content

Make the PG autoscaler bulk flag default for new pools - #61307

Closed
anthonyeleven wants to merge 1 commit into
ceph:mainfrom
anthonyeleven:bulk-flag-default
Closed

anthonyeleven wants to merge 1 commit into
ceph:mainfrom
anthonyeleven:bulk-flag-default

Conversation

@anthonyeleven

@anthonyeleven anthonyeleven commented Jan 9, 2025 •

Copy link
Copy Markdown
Contributor

Make the PG autoscaler bulk flag default for new pools.

There is support for this in the community to address the performance impact of low PG counts especially for index pools.

This complements #60492

The changes are tweaking docs and flipping the config option default value. Since the existing config option applies only to newly-created pools there will be no thundering herd of PG splits at upgrade time.

Signed-off-by: Anthony D'Atri [email protected]

@markhpc

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

Copy link
Copy Markdown
Contributor Author

jenkins retest this please
sigh

@kamoltat

Copy link
Copy Markdown
Member

Hi @anthonyeleven,

Thank you for your work on this PR and for addressing the issue of PGs starting with a low count in out-of-the-box clusters. While the bulk flag provides a valuable mechanism to allocate PGs more dynamically, I believe it may still be too risky to make it the default for new pools.

When the bulk flag is enabled, pools are allocated the maximum number of PGs based on their capacity relative to others in the cluster. While this approach ensures better utilization initially, it can lead to inactive PGs in large clusters. A notable issue arises when new pools are added: the recalculations of PGs by the autoscaler can cause older pools to scale down while the new ones scale up. This behavior has, in the past, disrupted stable clusters and led to operational challenges, especially with larger-size clusters.

Given these risks, I recommend we continue to make the bulk flag an optional feature for now, and in the meantime, I can explore ways to minimize PG merges when we create new pools.

Let me know what you think?

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

I defer to your judgement.

@mmgaggle

mmgaggle commented Feb 1, 2025 •

Copy link
Copy Markdown
Member

I put some additional thoughts here:

https://pad.ceph.com/p/bulk-auto-scaler

Even just having rate be configurable instead of inferred would make programming the auto scaler to maximize a PG budget and proportion it between pools based on target ratios easier.

Also, I think @dvanders had mentioned at dev summit leading up to Cephalocon that he thought the inactive / peering behavior might in fact be a bug. Dan, do you have a link to an issue relating to the inactive / peering issue that was being discussed at the summit?

I feel like if we're not going over 100-250 per OSD and we're still seeing inactive/peering issues with PGs, then something is just wrong.

@dvanders

dvanders commented Feb 1, 2025

Copy link
Copy Markdown
Contributor

Thanks @anthonyeleven @kamoltat @mmgaggle. My initial 2 second feedback is that even a simple change like this would need rethinking rgw_rados_pool_autoscale_bias and the cephfs meta pool bias defaults. And while I like the idea of starting with more PGs (because it sets up new clusters for optimal perf right out of the gate), I think there are several practical issues preventing this simple change. For example, my observation is that merging PGs is quite slow, even when they have very little data. I expect that bootstrapping a new cluster to take a long time, e.g.

  1. create a new empty ceph cluster
  2. create a bulk pool ... all 100 PGs/ OSD go to this pool
  3. create a 2nd bulk pool ... now the PGs will be split 50/50, so PGs will start merging, slowly.
    4 .... create a few more pools. Even more merging is queued up.

I'd like to dig more into @mmgaggle 's high level view on things. When planning clusters, I find it much better to think about use-cases, and mixing use-cases, instead of pools, to come up with the right mix of how to spend the PG budget.
Another 40000' view comment is that the PG autoscaler was originally meant to simplify things for users, but nowadays with so many options like targets/biases/bulk etc... it feels somehow even more complicated than when we had the PG calculator.

Lastly - my final 2 cents - automatically changing pg_num live is just too scary in practice: the risk of a service interruption is too high imho. Somehow it should be opt-in, or scheduled. The example above shows one case where it's worth reviewing exactly when the autoscaler implements the changes. (Idea: a cooling-off period might fix the cluster bootstrapping issue I mentioned above).

Proposal -- should we schedule design review discussion to find a consensus on how to improve pg autoscaling for T+?

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

Absolutely, cogent insights. I’d already anticipated needed to disable splits during upgrades, especially an upgrade that first introduces the target increase in my other PR. I hadn’t thought of merging as going down seemed rare but then I’m not the typical Ceph admin.

Agree about replacing one complexity with another. Clearly even after editing the docs I don’t fully grok the nuances. The behavior while creating pools didn’t occur to me but is a fantastic observation. I might have thought merges or splits on an empty cluster would be instantaneous, but of course pools get created at other times too, like at a prior job when RGW wasn’t in the initial deployment but the need for it appeared later.

The autoscaler is a worthy usability idea and I’d love to see it kaizen. Maybe an approach to raise the floor without having pg_num default be impracticality high for tiny clusters. As a function of OSD count? Though that gets complicated with multiple device classes and complex topologies.

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

The bulk flag appears to not behave as I thought it did, so barring additional feedback I'm closing this.

@anthonyeleven
anthonyeleven deleted the bulk-flag-default branch December 8, 2025 22:25
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