山西城乡建设厅网站,北京网站建设 标准型 新翼,汕头网,免费接码网页版中国文章目录 rados benchrbd bench-write测试工具Fio测试ceph rbd块设备的iops性能测试ceph rbd块设备的带宽测试ceph rbd块设备的延迟 性能调优 rados bench
参考#xff1a;https://blog.csdn.net/Micha_Lu/article/details/126490260 rados bench为ceph自带的基准测试工具https://blog.csdn.net/Micha_Lu/article/details/126490260 rados bench为ceph自带的基准测试工具rados bench用于测试rados存储池底层性能该工具可以测试写、顺序读、随机读三种类型.
写入速率测试
rados bench -p rbd-bak 10 write --no-cleanup顺序读速率测试
rados bench -p rbd-bak 10 seq随机读速率测试
rados bench -p rbd-bak 10 randrbd bench-write
rbd bench-write为ceph自带的基准性能测试工具rbd bench-write用于测试块设备的简单写入测试。
rbd bench-write rbd-bak/image1 --io-size 1M --io-pattern seq --io-threads 32 --io-total 10G测试结果取最后一行elapsed的值带宽为bytes/sec对应参数值单位为bytes/sec可根据需要转换为MB/sIOPS为ops/sec对应参数值
测试工具Fio
yum install fio -y 测试ceph rbd块设备的iops性能
关于fio命令的参数参考https://blog.csdn.net/zhiboqingyun/article/details/123368887
每秒的输入输出量(或读写次数)是衡量磁盘性能的主要指标之一
测试随机写4kb文件的iops性能
fio --name4krandwrite_iops --filename/dev/rbd0 --numjobs8 --bs4k --ioenginelibaio --direct1 --randrepeat0 --norandommap --rwrandwrite --group_reporting --iodepth512 --iodepth_batch128 --iodepth_batch_complete128 --gtod_reduce1 --runtime10顺序写4kb文件的iops性能
fio --name4kwrite_iops --filename/dev/rbd0 --numjobs8 --bs4k --ioenginelibaio --direct1 --randrepeat0 --norandommap --rwwrite --group_reporting --iodepth512 --iodepth_batch128 --iodepth_batch_complete128 --gtod_reduce1 --runtime10顺序读4kb文件的iops性能
fio --name4kread_iops --filename/dev/rbd0 --numjobs8 --bs4k --ioenginelibaio --direct1 --randrepeat0 --norandommap --rwread --group_reporting --iodepth512 --iodepth_batch128 --iodepth_batch_complete128 --gtod_reduce1 --runtime10随机读4kb文件的iops性能
fio --name4krandread_iops --filename/dev/rbd0 --numjobs8 --bs4k --ioenginelibaio --direct1 --randrepeat0 --norandommap --rwrandread --group_reporting --iodepth512 --iodepth_batch128 --iodepth_batch_complete128 --gtod_reduce1 --runtime10测试ceph rbd块设备的带宽
测试ceph rbd设备写4MB文件的极限带宽性能
fio --name4mwrite_bw --filename/dev/rbd0 --numjobs8 --bs4m --ioenginelibaio --direct1 --randrepeat0 --norandommap --rwwrite --group_reporting --iodepth512 --iodepth_batch128 --iodepth_batch_complete128 --gtod_reduce1 --runtime10bw这组进程的总带宽每个线程的带宽
测试ceph rbd块设备的延迟
测试ceph rbd设备顺序写4kb文件的延迟性能
fio --name4kwrite_lat --filename/dev/rbd0 --numjobs8 --bs4k --ioenginesync --direct1 --randrepeat0 --norandommap --rwwrite --group_reporting --runtime10一些参数解释 slat 表示fio 提交某个I/O的延迟min为最小值max为最大值avg为平均值stdev为标准偏差。 对于同步I / O不会显示该行。 clat 表示从提交到完成I / O的时间。 lat 表示从fio将请求提交给内核再到内核完成这个I/O为止所需要的时间
usec微秒msec毫秒1ms1000us
测试ceph rbd设备顺序读4kb文件的延迟性能
fio --name4kread_lat --filename/dev/rbd0 --numjobs8 --bs4k --ioenginesync --direct1 --randrepeat0 --norandommap --rwread --group_reporting --runtime10测试ceph rbd设备随机读4kb文件的延迟性能
fio --name4krandread_lat --filename/dev/rbd0 --numjobs8 --bs4k --ioenginesync --direct1 --randrepeat0 --norandommap --rwrandread --group_reporting --runtime10测试ceph rbd设备随机写4kb文件的延迟性能
fio --name4krandwrite_lat --filename/dev/rbd0 --numjobs8 --bs4k --ioenginesync --direct1 --randrepeat0 --norandommap --rwrandwrite --group_reporting --runtime10性能调优
CPU调优 ceph是使用软件定义的存储因此其性能很大程度上依赖于OSD节点的CPU速度。CPU主频越高则运行代码的速度就越快同时处理io请求的时间就越短。 磁盘调优 在磁盘参数和硬件配置相同的情况下大量的io请求会向ceph osd写入数据同时会向其他osd节点写入数据副本。如果OSD节点数量过少那么会导致性能不高因此增加osd数量在某种程度上能提升写操作性能。 系统配置参数调优 设置磁盘的预读缓存:【该参数通过预读取数据并将其加载到随机存取存储器中加快磁盘读操作设置为较高的值有助于客户端顺序读取操作】
echo 8192 /sys/block/vdc/queue/read_ahead_kb设置系统的进程数量
echo 4194303 /proc/sys/kernel/pid_maxceph集群的配置参数
为集群定义内部网络
[global]
cluster network {cluster network/netmask}设置最大文件打开数
[global]
max open files 131072ceph启用rbd缓存默认的缓存机制是write-back
[client]
rbd cache true
rbd cache size 268435456 #rbd缓存大小
rbd cache max dirty 134217728 #rbd缓存脏数据最大字节数超过这个值之后数据会写回备用存储。如果这个值设置为0那么ceph使用的缓存模式是write-through为了创建一个一致的提交操作文件系统需要先静默写操作并执行一次sync操作。然后将日志中的数据写到数据分区再释放日志。如果同步操作太频繁会导致日志中存放的数据很少日志没有得到重复的利用。配置不那么频繁的同步操作将有助于文件系统更好的合并写操作。有助于提升性能。 下面的参数定义了两次同步之间最小和最大的时间间隔。
[OSD]
filestore min sync interval 10
filestore max sync interval 15文件存储队列的最大操作数
[OSD]
filestore queue max ops 25000
filestore queue max bytes 10485760 #每个操作的最大字节数文件系统最大操作线程数
[OSD]
filestore op threads 32其他的一些参数有 关于journal的参数 比如可以设置一次性写入的最大字节数 journal max write bytes 、 一次性在队列中的操作数 journal queue max ops等
关于osd config tuning osd一次可写入的最大值osd max write size osd进程的最大线程数osd op threads
关于osd client tuning rbd 缓存大小rbd cache size
具体参数描述可以参考文章。