测试 ceph 集群的性能
可以在修改前后,做 ceph 集群性能测试,进行对比
新增 uat pool
ceph osd create uat 128 128
write 测试(先测试 write,不然 seq 会报错)
rados -p uat -t 30 bench 30 write --no-cleanup --run-name xxx
seq 测试
rados -p uat -t 30 bench 30 seq --run-name xxx
清除 uat pool 中 benchmark 数据
rados -p uat cleanup
控制 ceph 集群中 osd 内存使用量
使用 ansible-ceph 部署的 luminous 版本的 ceph,默认采用 automatic cache sizing,Bluestore 尝试通过 osd_memory_target 配置选项将 osd 堆内存使用率保持在指定的目标大小一下。
本集群中 osd memory target = 18925868810,使用时间长了,导致 osd 使用内存超过 60%。每个 osd 服务器有 20 块硬盘,对应 20 个 osd,500Gb 内存。由于 ceph 集群和 openstack 集群在一套服务器上,导致最终openstack 分配虚拟机到达一定数量后,集群内存不够用。
[osd]
#osd memory target = 18925868810
osd memory target = 644245094418925868810
修改 ceph 配置文件 /etc/ceph/ceph.conf,设置 osd memory target = 6442450944,每块 osd 最大使用 6Gb 内存
[osd]
#osd memory target = 18925868810
osd memory target = 644245094418925868810
重启 cmp33 上的 osd
systemctl list-units -t service | grep osd | grep active | awk '{print $1}' | xargs systemctl restart
查看 cmp33 上内存使用率
ps aux | grep osd | grep -v grep | awk '{sum += $4}END{print sum}'
查看 cmp33 上内存使用量,单位 kb
ps aux | grep osd | grep -v grep | awk '{sum += $6}END{print sum}'
20200924
修改 ceph 生产集群所有节点的配置文件 /etc/ceph/ceph.conf 中 osd memory target = 6442450944,依次执行 systemctl list-units -t service | grep osd | grep active | awk '{print $1}' | xargs systemctl restart
,每次等 ceph health 恢复到 health_ok 在继续下一个节点
参考文章:
https://ceph.io/planet/ceph-luminous%E7%89%88%E6%9C%AC%E9%99%90%E5%88%B6osd%E7%9A%84%E5%86%85%E5%AD%98%E4%BD%BF%E7%94%A8/
https://docs.ceph.com/en/latest/rados/configuration/bluestore-config-ref/
https://ceph-users.ceph.narkive.com/s4RkzClO/ceph-read-benchmark