TOOLS · CEPH
Ceph PG calculator
Calculate pg_num for every pool with the PGCalc rule or prepare the autoscaler settings, estimate how many PG instances each OSD holds before and after losing a node, and copy the ceph and pveceph commands generated from the same table.
Calculate the PGs of your pools
It starts from the base installation, as in the Ceph calculator: 3 nodes with four NVMe drives and one RBD pool in 3-way replication. The rule gives 512 PGs, because 100 × 12 / 3 is 400 and the nearest power of 2 is 512. Change the inputs or start from an example.
Calculate the PGs of your pools
| Pool | Protection | Class | Pool's share of the class data | pg_num | PG instances per OSD, this pool | Actions |
|---|---|---|---|---|---|---|
| % | 512 | 128.0 instances per OSD | ||||
| % | 512 | 128.0 instances per OSD |
PGs calculated: pool vm-disks: 512. Estimated maximum PG instances per OSD: 128, below mon_max_pg_per_osd 250.
After losing a node, the remaining nodes are not enough for every instance: 512 cannot be placed. The estimated maximum is below mon_max_pg_per_osd (250); the hard limit of a single OSD is 750. Comparing the estimated maximum with mon_max_pg_per_osd is a conservative check: the Ceph TOO_MANY_PGS warning uses the cluster average. The scale runs up to the hard limit of a single OSD.
After losing a node, the remaining nodes are not enough for every instance: 512 cannot be placed. The estimated maximum is below mon_max_pg_per_osd (250); the hard limit of a single OSD is 750. Comparing the estimated maximum with mon_max_pg_per_osd is a conservative check: the Ceph TOO_MANY_PGS warning uses the cluster average. The scale runs up to the hard limit of a single OSD.
ceph osd crush rule create-replicated rep-nvme default host nvme ceph osd pool create vm-disks 512 512 replicated rep-nvme ceph osd pool set vm-disks size 3 ceph osd pool set vm-disks min_size 2 ceph osd pool application enable vm-disks rbd ceph osd pool set vm-disks pg_autoscale_mode warn
On this page
How pg_num is calculated
The rule is the one PGCalc uses, described in the Ceph documentation: start from the target PGs per OSD, multiply by the OSDs of the class and by the pool's share of the data, and divide by the width of the pool, that is, the number of copies with replication or k+m with erasure coding.
x = target × OSDs × share / width
x = max(x, OSDs / width)
pg_num = nearest power of 2 to x
if pg_num < 0.75 × x then pg_num = 2 × pg_num
Worked example: 12 OSDs, a single 3-way replicated pool, target 100. x is 100 × 12 / 3 = 400; the nearest power of 2 is 512, which is not below 75% of 400, so pg_num is 512. The rule doubles the result when the nearest power of 2 is more than 25% below x: x = 1,365 gives 1,024, x = 1,366 gives 2,048.
The starting target is 100, the default of mon_target_pg_per_osd. The PGCalc rule uses 200 when the OSD count may double, so that you do not have to raise the pg_num of the pools soon after creating them.
PGCalc or the autoscaler
With pg_autoscale_mode on, Ceph adjusts pg_num on its own, based on the data stored and the data expected. In autoscaler mode the calculator sets target_size_ratio for each pool to its share within the class: it is a relative weight, not a hard quota, and the autoscaler normalises it across the pools that share the same OSDs. Pools that will hold most of the data get bulk, which makes them start with many PGs instead of growing a little at a time.
In PGCalc mode the calculator sets the autoscaler to warn: pg_num stays as calculated, and Ceph warns if it considers it far from optimal.
PG instances per OSD: average and maximum
The average is not enough. In the model every pool spreads across the nodes in proportion to capacity, with at most one instance of each PG per node, and the instances of all pools add up on the same OSDs. Ceph applies mon_max_pg_per_osd (250 by default in Squid and Tentacle) to the cluster average: above it, Ceph raises TOO_MANY_PGS and refuses pools or pg_num values that would exceed it. The calculator also compares it with the estimated maximum on a single OSD, as a conservative check, and shows the hard limit of a single OSD, three times as much with osd_max_pg_per_osd_hard_ratio set to 3: above it the OSD creates no new PGs. It repeats the check after losing a node, when the instances of the lost node are redistributed over the others.
Worked example: three nodes with 12, 1 and 1 OSDs, one 3-way replicated pool with 512 PGs, host failure domain. The average is about 110 instances per OSD, but every PG has a copy on each node: the OSDs of the two single-drive nodes carry 512 instances each, more than twice mon_max_pg_per_osd.
Ready-made commands
The commands come from the same pool table. With ceph the calculator generates: a replicated CRUSH rule per device class; pool creation with size and min_size; for erasure coding, a profile with crush-device-class and crush-failure-domain; allow_ec_overwrites for RBD and CephFS; the application enabled on the pool and the autoscaler mode.
With pveceph pool create and --erasure-coding, Proxmox VE creates two pools: <name>-data with erasure coding, the given pg_num and allow_ec_overwrites already enabled, and <name>-metadata, replicated with 32 PGs. --size, --min_size and --crush_rule apply to the metadata pool, so the min_size of the data pool is set with a separate command. For EC pools not used for RBD the calculator adds --add_storages 0, because with erasure coding pveceph also creates an RBD storage entry in Proxmox VE by default. On Proxmox VE, CephFS is created with pveceph fs create, and an EC pool is added as a data pool with ceph fs add_data_pool.
Formulas and sources
Model 1.2.0, dated 19 October 2026, shared with the Ceph calculator. The behaviour of pveceph with erasure coding was verified in the Proxmox VE source code, not only in the documentation.
Need a second opinion on your pools?
We review the pools, CRUSH rules and PGs of an existing Ceph cluster, or define them as part of a new cluster design.
Ceph PG calculator FAQ
What are Ceph placement groups?
Placement groups, or PGs, are the groups into which Ceph splits the objects of a pool: each PG lives on a set of OSDs, one per copy or chunk, and Ceph moves, recovers and balances data PG by PG. With too few PGs data is spread unevenly, with too many the OSDs use more memory and CPU.
Why is pg_num a power of 2?
Ceph assigns every object of a pool to a PG with a hash: with pg_num a power of 2 each PG gets the same share of objects on average, with another value some PGs get twice as many as others. That is why the PGCalc rule always rounds to a power of 2.
100 or 200 PGs per OSD?
In Ceph, 100 PGs per OSD is the default of mon_target_pg_per_osd and suits a cluster that will not grow. The PGCalc rule uses 200 when the OSD count may double, so that you do not have to raise pg_num soon after creating the pools. Staying below mon_max_pg_per_osd, 250 by default, matters more than the exact value.
What does the PG autoscaler do, and when should I turn it off?
The Ceph PG autoscaler adjusts the pg_num of every pool based on the data stored, target_size_ratio and target_size_bytes, and with bulk it makes large pools start with many PGs. Set it to warn (warnings only) or off when you want to decide pg_num yourself, for example to avoid unplanned data movement.
What is mon_max_pg_per_osd?
In Ceph, mon_max_pg_per_osd defaults to 250 in Squid and Tentacle and applies to the cluster average of PG instances per OSD: above it, Ceph raises TOO_MANY_PGS and refuses pools that would exceed it. The limit of a single OSD is three times as much, with osd_max_pg_per_osd_hard_ratio set to 3: above it the OSD creates no new PGs. The calculator also compares the estimated maximum on a single OSD with mon_max_pg_per_osd, before and after losing a node, as a conservative check.
How many PGs should an erasure-coded Ceph pool get?
In an erasure-coded Ceph pool every PG has k+m instances, one per chunk: the PGCalc rule therefore divides by k+m instead of by the number of copies. An EC 8+3 pool on 288 OSDs, with 80% of the class data and a target of 100, gets 2,048 PGs.
How does it differ from the PG Calc in the Ceph documentation?
The PG Calc in the Ceph documentation applies the same rule, but only to replicated pools. This calculator adds erasure coding, device classes, an estimate of the instances on every OSD before and after losing a node, and commands for pveceph; the old ceph.com/pgcalc address now returns a 404 error.
- 700+ active customers
- 24h support, every day
- GDPR data kept in Italy
We design your Ceph cluster
We size drives, network, block.db and protection for your workload and, before production, test how the cluster reacts to failures.
+39 0421 1885889 · sales@rackone.it