Why does Red Hat recommend less than 0.01% chance for any descendent subdirectory to be pinned by setting the ceph.dir.pin.random attribute?
Explanation
The percentage is the probability with which the tree should be pinned to a mds rank. A higher percentage/probability indicates that the pinning (relocation) should be done more aggressively. Random pinning could lead to more sub-trees to get distributed leading to increased latencies while fetching information from the auth mds in case of a cache miss. Hence, the lower the percentage/probability the lesser the distribution of sub-trees and hence higher the cache performance.
It is therefore advised that the random pin percentage should be as low as possible i.e. below the 0.01% mark. A Content from github.com is not included.FIX is under development to address this issue. However, it will not be available until the Squid release and any downstream releases that are dependent on it.
When it comes to increasing the percentage to enhance performance, there is no known benefit to having a lot of subtrees, and unwinding the spread of many subtrees can be very sluggish. There is a Content from tracker.ceph.com is not included.DOC FIX that explains the intended use-case, but in short: it is for permitting the use of multi-mds without the "default" load balancer (i.e. the automated load balancer) when distributed ephemeral pins cannot be utilised because the data structure in the FS is unknown.
How to verify and make changes in the percentage value?
-
The maximum chances for any descendent subdirectory to be pinned can be verified via:
# ceph tell <MDS NAME> config show | grep mds_export_ephemeral_random_max... where MDS NAME can be taken from
ceph orch ps | grep mds -
Incase, if needed to increase the chance percentage more than 0.01 (recommended is less than 0.01), it can be adjusted via modifying
mds_export_ephemeral_random_maxparameter.# ceph config set mds mds_export_ephemeral_random_max <NEW PERCENTAGE> -
Once the new maximum value is set, set the attribute to the volume mount path.
# setfattr -n ceph.dir.pin.random -v <NEW PERCENTAGE> <VOLUME MOUNT PATH>
For more information about this attribute, refer Ephemeral pinning policies