Calculation formula for PG:
Calculation formula for the entire cluster PG
The calculation formula for PG in each pool:
Total PGs = (TOTAL_NUMBER_OF_OSD *)/Max_replication_count/pool_count
The result of the settlement is taken up to the value of the n-th square of the 2. For example, the total number of OSD is 160, the number of copies of the number of 3,pool is also 3, then the result is calculated according to the above formula is 1777.7. Take 2 of the n-th is 2048, then the number of PG allocated per pool is 2048.
When changing the number of PG in a pool, you need to change the number of PGP simultaneously. PGP is a dedicated PG for the management of placement, and it should be consistent with the number of PG. If you increase the pool's pg_num, you need to increase the pgp_num at the same time, keeping them consistent in size so that the cluster can rebalancing normally. The following describes how to modify Pg_num and Pgp_num.
Check the number of PG in POOL2
[Root@mon1 ~]# ceph OSD Pool get pool2 pg_num
pg_num:128
[root@mon1 ~]# ceph OSD Pool get pool2 pgp_num
pgp_n um:128
[Root@mon1 ~]#