zfs读写性能测试 下载本文

内容发布更新时间 : 2024/5/19 3:35:11星期一 下面是文章的全部内容请认真阅读。

二、在debain上测试zfs的iops

测试方法

测试工具: FIO 测试时数据块大小为 4k、8k、16k、32k、64k,分别进行随机读和随机写的操作。 测试方法: 1、用zfs,在debain 上,9块1T硬盘搭建一个raidz,进行随机读和随机写的IOPS的测试 2、用zfs,在debain 上,9块1T硬盘搭建一个raidz,两块512GSSD进行加速,进行随机读和随机写的IOPS的测试 硬件环境: 主板:华硕P8B-C/4L CPU: E3-1230V2 扩展卡:LSI 9211-8i 内存:8GB 操作系统:debian 8.0.2 内核:Linux debian 3.16.0-4-amd64 硬盘数:9块1T硬盘2 块512G ssd 1、用zfs组建raidz root@debian:/brick/brick2# zpool create testzpool raidz -f sdc sdh sdg sdi sdl sdj sdk sdf sdb

2、FIO测试

/usr/local/bin/fio --name=/testzpool/test --direct=0 --iodepth=96 --rw=randread -- ioengine=posixaio --bs=4k --size=16G --numjobs=20 --runtime=3600 --group_reporting >> /brick/brick2/zfs.log /usr/local/bin/fio --name=/testzpool/test --direct=0 --iodepth=96 --rw=randwrite -- ioengine=posixaio --bs=4k --size=16G --numjobs=20 --runtime=3600 --group_reporting >> /brick/brick2/zfs.log 3、加速前测试结果

测试类型 4K 100% random read 4K 100% random write 8K 100% random read 8K 100% random write 16K 100% random read 16K 100% random write 32K 100% random read 32K 100% random write 64K 100% random read 64K 100% random write IOPS 388 198 323 285 361 311 376 320 368 316 用zfs建立mirror(raid10)

root@debian:/home/cloud# zpool create -f testpool mirror sdb sdf mirror sdl sdj mirror sdd sdc mirror sdk sdg sdi 测试结果 测试类型 4K 100% random read 4K 100% random write 8K 100% random read 8K 100% random write 16K 100% random read 16K 100% random write 32K 100% random read 32K 100% random write 64K 100% random read 64K 100% random write IOPS 1047 586 949 544 895 550 1070 601 1045 646 4、加压缩参数

zfs set compression=gzip testpool 测试类型 4K 100% random read 1074 4K 100% random write 1757 8K 100% random read 1065 8K 100% random write 1611 16K 100% random read 1072 16K 100% random write 1578 32K 100% random read 1056 32K 100% random write 1253 64K 100% random read 1067 64K 100% random write 771 IOPS 6、添加缓存加速命令:

root@debian:/brick/brick2# zpool add testzpool log mirror sde1 sde2 cache sdf1 7、加速后测试结果

测试类型 IOPS 4K 100% random read 1141 4K 100% random write 654 8K 100% random read 1096 8K 100% random write 638 16K 100% random read 1078 16K 100% random write 628 32K 100% random read 1086 32K 100% random write 586 64K 100% random read 945 64K 100% random write 530 secondarycache=all recordsize=512

zfs create -o mountpoint=/testpool -o recordsize=512 -o secondarycache=all testpool/testpool

zpool create -o ashift=12 -o autoreplace=on zp1