Skip to main content
RunBook Academy

CephXXI · PG AutoscalePG Autoscale

target_size_bytes and target_size_ratio

Intermediate⏱ ~15 minceph

What you'll learn

  • Set target_size_bytes and target_size_ratio on a pool
  • Choose between absolute and proportional targets
  • Predict the PG count a target produces
  • Recognise the health warning raised by over-committed targets

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

The autoscaler’s weakness is that it can only see the present. You know things it does not: that this pool is the landing zone for a 40 TB migration next quarter, that this one will never exceed 2 TB. Target size is the interface for handing over that knowledge, and it converts the autoscaler from a reactive tool into a planning one.

The two forms

target_size_bytes — an absolute figure. “This pool will hold 40 TB of user data.”

ceph osd pool set migration-landing target_size_bytes 40T

target_size_ratio — a proportion of the cluster. “This pool will occupy 30% of raw capacity.”

ceph osd pool set migration-landing target_size_ratio 0.30

Either one replaces SIZE as the module’s input, so the recommendation reflects the destination rather than the starting point. The pool gets its final PG count immediately, and the data grows into it — no splits along the way, no repeated rebalances.

Which one to use

UseWhen
target_size_bytesYou know the workload’s absolute size, and cluster capacity is fixed
target_size_ratioYou expect the cluster to grow, and the pool should keep its share

The ratio form is the more durable of the two on a cluster you expect to expand: add OSDs and a pool declared at 0.30 still gets 30% of the PG budget, whereas a pool declared at 40 TB becomes a progressively smaller fraction and its PG count drifts down relative to the whole.

Set only one. If both are set, target_size_ratio wins and Ceph raises a health warning telling you so.

Over-commitment

POOL_TARGET_SIZE_RATIO_OVERCOMMITTED

Targets are claims on capacity, and the module adds them up. Declare 0.4, 0.4, and 0.5 across three pools and you have promised 130% of the cluster. The module scales the claims back proportionally so the PG budget still adds up, and warns you — because if all three pools actually reach their declared size, you run out of disk.

ceph osd pool set pool-a target_size_ratio 0.30
ceph osd pool set pool-b target_size_ratio 0.30
ceph osd pool set pool-c target_size_ratio 0.20
# total 0.80 — leaves headroom, no warning

Quiz

Knowledge check · 4 questions

  1. Q1. A pool currently holds 8 TB. You set `target_size_bytes 2T`. What happens to the autoscaler recommendation?

  2. Q2. Setting both target_size_bytes and target_size_ratio on the same pool causes Ceph to use target_size_ratio and raise a health warning.

  3. Q3. Plan the target settings for a capacity build-out.

    A 300 TB raw cluster hosts `rbd-vms` (currently 40 TB user data, size 3) and an empty `s3-archive` pool that will receive 60 TB of user data over the next two months via an EC 4+2 profile. Finance has approved another 300 TB of raw capacity for delivery in six months.

  4. Q4. Why does Ceph warn when the sum of target_size_ratio across pools exceeds 1.0, rather than just rejecting the setting?

Passing score: 75%. Answers are checked in this browser.

Production discipline

Treat target size as documentation with teeth: it should match a capacity plan somebody wrote down, not a guess typed at a prompt. Review targets whenever the cluster grows, and clear the ones tied to finished migrations. A quarterly walk through autoscale-status comparing declared targets against actual growth catches both stale claims and pools quietly outgrowing their plan.

Cross-course references

  • Kubernetes: a namespace ResourceQuota is the same idea — a declared future claim that shapes present scheduling
  • Linux: think of it as thin-provisioning a filesystem, with the same over-commitment discipline