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.
Beta This calculator is in beta. The values and commands are derived from the formulas and assumptions explained on this page: we provide them as is, with no guarantee that they are accurate, complete or suited to your case. Before running the commands on a production cluster, check them against the official documentation or with a systems engineer. To the extent permitted by law, we accept no liability for damages or costs resulting from decisions based on these calculations.
Calculate the PGs of your pools
PG limits and share basis
| Pool | Application and role | Protection | Class | Share of the planned raw capacity in the class (%) | Initial PGs, PGCalc estimate | PG instances per OSD, this pool | Actions |
|---|---|---|---|---|---|---|---|
| % | 512 | 128.0 instances per OSD | |||||
| % | 512 | 128.0 instances per OSD |
The raw share includes replication or erasure coding: pools with the same logical data can need different raw shares, for example the same data in 3-way replication and EC 4+2 come to 66.67% and 33.33%. target_size_ratio is a relative weight between pools, not a fixed share.
pg_num is a PGCalc estimate of the initial PGs, not the autoscaler algorithm: the autoscaler works with the cluster's mon_target_pg_per_osd (default 100), which the target chosen here does not change. bulk starts a data pool with its full complement of PGs; for metadata and indexes it is usually left off.
Metadata and index pools matter more for object count and omap than for bytes: the share represents them poorly, and the autoscaler handles them with its bias. The commands do not touch .mgr or other existing pools, but their PGs weigh on the same OSDs.
Estimated initial PGs: 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. Creation: at the heaviest step the monitor counts 128.0 instances per OSD under rule rep-nvme, within mon_max_pg_per_osd (250). The estimated maximum is within mon_max_pg_per_osd (250); the hard limit of a single OSD is 750.
After losing a node, the remaining nodes are not enough for every instance: 512 cannot be placed. Creation: at the heaviest step the monitor counts 128.0 instances per OSD under rule rep-nvme, within mon_max_pg_per_osd (250). The estimated maximum is within mon_max_pg_per_osd (250); the hard limit of a single OSD is 750.
TOO_MANY_PGS warning: cluster average 128.0 instances per OSD across 12 OSDs, within mon_max_pg_per_osd (250).
Three different checks. On every creation the monitor counts the PGs of the pools on the same CRUSH rule and divides them by the OSDs under its root. The TOO_MANY_PGS warning looks at the average of the whole cluster. The hard limit applies to a single OSD. The maximum is estimated with an ideal distribution: discrete PGs, weights, reweight and object distribution move the real numbers, to be checked with ceph osd df tree, ceph df detail and the PG state.
# Beta calculator: commands provided as is, without warranty. Check them before running them on a production cluster. # CRUSH rules per device class: create them once ceph osd crush rule create-replicated rep-nvme default host nvme ceph osd pool create vm-disks --pg_num 512 --pgp_num 512 --pool_type replicated --rule rep-nvme --size 3 --autoscale_mode warn --bulk ceph osd pool set vm-disks min_size 2 ceph osd pool application enable vm-disks rbd # The commands only touch these pools: .mgr and other existing pools stay as they are, but their PGs weigh on the same OSDs. The autoscaler does not scale pools with overlapping CRUSH roots, such as a pool on the default root alongside per-class pools. # pg_num above is a PGCalc estimate with target 100: it does not set mon_target_pg_per_osd. Value in use in the cluster: ceph config get mgr mon_target_pg_per_osd # Check after creation: PGs per pool, usage per OSD and per pool, PG state ceph osd pool autoscale-status ceph osd df tree ceph df detail ceph pg stat
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 planned raw capacity of the class, and divide by the width of the pool, that is, the number of copies with replication or k+m with erasure coding. The result is the initial PG count, an estimate: the autoscaler does not use this formula.
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 Squid autoscaler guide recommends 200 for all but the very smallest clusters. Choosing the target here changes the estimate of the initial PGs, not the cluster configuration: the commands read the value in use with ceph config get mgr mon_target_pg_per_osd and, if you choose 200, suggest ceph config set global mon_target_pg_per_osd 200 as a comment, because it applies to the whole cluster and to every pool.
The share is of the raw capacity of the class, so it includes replication or erasure coding. Pools with the same logical data need different raw shares: the same data in 3-way replication and EC 4+2 take raw capacity in a 3 to 1.5 ratio, that is 66.67% and 33.33%. If you prefer to reason in logical data, the calculator converts it, class by class:
q_raw = q_logical × amplification / Σ(q_logical × amplification)
A share of 0 excludes the pool from the plan: the commands do not create it. A real empty pool, instead, still has its PGs.
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, using the cluster's mon_target_pg_per_osd: the initial PGs in the table are the starting point, which the autoscaler may change. In autoscaler mode the calculator sets target_size_ratio for each pool to its raw share within the class: it is a relative weight, not a hard quota, and the autoscaler compares it with that of the pools sharing the same OSDs. bulk is a property of each pool: when on, the pool starts with its full complement of PGs instead of growing a little at a time. The calculator prefills it from the role, on for data pools and off for metadata and indexes, which do not grow large in bytes even when they hold the biggest share of a small class.
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. The commands only configure the pools in the table: .mgr and the other existing pools stay as they are, but their PGs weigh on the same OSDs, and the autoscaler does not scale pools with overlapping CRUSH roots, such as a pool on the default root alongside per-class pools. After creation, ceph osd pool autoscale-status shows what it would do.
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 has three different checks. Whenever a pool is created or its pg_num or size is increased, the monitor counts the instances of the pools that use the same CRUSH rule, divides them by the OSDs under the rule's root, at least 3, and above mon_max_pg_per_osd (250 by default in Squid and Tentacle) it rejects the command. The TOO_MANY_PGS warning compares the same limit with the average of the whole cluster across the in OSDs. A single OSD has a hard limit, three times as much with osd_max_pg_per_osd_hard_ratio set to 3: above it, it creates no new PGs. The calculator shows them separately, lets you change both parameters and also compares the maximum on a single OSD with mon_max_pg_per_osd, as a conservative check, before and after losing a node.
The maximum is estimated with an ideal distribution: discrete PGs, weights, reweight and object distribution can make the real cluster differ, which you check with ceph osd df tree, ceph df detail and the PG state.
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. Application (RBD, CephFS, RGW) and role (data, metadata, index) are fields of each pool: the name is only a name, and renaming a pool does not change what the commands do. Metadata and indexes live in omap, which an EC pool does not support: for those roles the calculator allows replication only.
With ceph the calculator generates: a replicated CRUSH rule per device class; the creation of each pool with size, autoscaler mode, bulk and weight already in the command, using the Squid and Tentacle named parameters; then min_size and the application. The size at creation matters: the monitor checks the pool with the size it is created with, and a pool created with the default size and reduced afterwards can be rejected. A 2-way replicated pool with 2,048 PGs on 24 OSDs, created with size 3, would count 2,048 × 3 / 24 = 256 instances per OSD, above 250. The calculator does not raise mon_max_pg_per_osd to get around the check.
For erasure coding it generates a profile with crush-device-class and crush-failure-domain, and allow_ec_overwrites for RBD and CephFS. An RBD data pool on EC needs a replicated pool for metadata and omap: the calculator creates it with the -metadata suffix and 32 PGs, like pveceph, counts it in the checks and shows how to create images (rbd create --data-pool). For CephFS the commands only create the pools: ceph fs new and ceph fs add_data_pool are left as comments, with a replicated default data pool and the EC pool added. For RGW the application tag does not configure zones and placement targets. The check commands come last.
Warnings about min_size and protection appear next to the results and as comments in the copied commands: 3-way replication with min_size 2 is the ordinary choice; 2-way replication starts at min_size 2, which stops I/O at the first failure, and min_size 1 is an advanced, risky choice; with EC it starts at k+1, and m = 1 is not recommended in production. The Ceph calculator gives the same judgments.
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. pveceph creates the pool without a size and applies it afterwards: if pg_num at the default size would exceed mon_max_pg_per_osd, the pool starts with fewer PGs and grows with ceph osd pool set <name> pg_num after the size change. bulk, which pveceph does not know, is set with ceph osd pool set.
Formulas and sources
Model 1.3.0, dated 28 October 2026, shared with the Ceph calculator. The behavior of pveceph was verified in the Proxmox VE source code, not only in the documentation; the ceph osd pool create parameters and the monitor check in the Ceph source code. The syntax was compared with the Squid and Tentacle documentation and sources; try the commands on a test cluster before production.
- Ceph, placement groups and the autoscaler
- Ceph, the PGCalc rule
- Ceph, pools, size and min_size
- Ceph, erasure coding
- Proxmox VE, Ceph pools and erasure coding
- Proxmox VE, pveceph syntax
- Proxmox VE, pool creation source code
- Ceph, health checks and TOO_MANY_PGS
- Ceph, osd pool create parameters (Tentacle)
- Ceph, the PG check on creation (OSDMonitor, Squid)
- Ceph, creating a CephFS file system
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?
The mon_target_pg_per_osd default is 100; the Squid autoscaler guide recommends 200 for all but the very smallest clusters. The value matters to the autoscaler, which reads it from the cluster: choosing 200 in the calculator changes the estimate of the initial PGs, not the configuration, which you change with ceph config set global mon_target_pg_per_osd. 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, target_size_bytes and the cluster's mon_target_pg_per_osd, and with bulk it makes large pools start with their full complement of 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. The monitor uses it when you create a pool or increase pg_num or size: it counts the instances of the pools on the same CRUSH rule, divides them by the OSDs under its root and rejects the command above the limit. The TOO_MANY_PGS warning instead compares the average of the whole cluster across the in OSDs. A single OSD has a hard limit, three times as much with osd_max_pg_per_osd_hard_ratio set to 3. The calculator shows the three checks and also compares the estimated maximum on a single OSD with mon_max_pg_per_osd, before and after losing a node.
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 raw capacity of the class 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