标签归档:pg

ceph的pool的pg修改值的计算

pg的修改
当扩大pg num的时候,有时候会遇到报错:

限制pg spliting的参数来源于mon_osd_max_split_count value。
查看配置文件

计算脚本:

结果输出

block_size的计算

If the value of the above calculation is less than the value of ( OSD# ) / ( Size ), then the value is updated to the value of ( OSD# ) / ( Size ). This is to ensure even load / data distribution by allocating at least one Primary or Secondary PG to every OSD for every Pool.
The output value is then rounded to the nearest power of 2.
Tip: The nearest power of 2 provides a marginal improvement in efficiency of the CRUSH algorithm.
If the nearest power of 2 is more than 25% below the original value, the next higher power of 2 is used.

pg与osd的对应关系查找

利用pg在pool以及osd的分布关系可以更好的分析pg的分布是否均匀

首先获取pg的query数据。利用Ansible模块获取数据。数据如下:

利用python分析该数据: