The number of placement groups is calculated the following way:
(OSDs * 100)
Total PGs = ------------
Replicas
The number then is rounded up to the next power of two while honoring the magic number of 100 to 200 Target PGs.
Total PGs
Target PGs = ---------
OSDs
Example:
ceph osd pool set rbd pg_num 8192
By default, the number of placement grups for placement is set to the same value as the number of placement groups.
ceph osd pool set rbd pgp_num 8192
# /etc/ceph/ceph.conf
[mds]
# The number of inodes to cache, default 100000
mds_cache_size = 30000000
# /etc/ceph/ceph.conf
[mds]
# hard limit on the size of directory fragments, default 100000
mds_bal_fragment_size_max = 10000000
# /etc/ceph/ceph.conf
osd_max_backfills = 1
osd_recovery_max_active = 1
osd_scrub_during_recovery = false
osd_recovery_op_priority = 1
# online changes
ceph tell osd.* injectargs '--osd_max_backfills=9'
ceph osd pool application enable ${POOL} rbd
ceph osd pool application enable ${POOL} cephfs