高端品牌网站建设注意事项,企业 网站 设计,天眼通查公司查询,沈阳网站建设电话FIO是测试IOPS的非常好的工具#xff0c;用来对硬件进行压力测试和验证#xff0c;支持13种不同的I/O引擎#xff0c;包括:sync,mmap, libaio, posixaio, SG v3, splice, null, network, syslet,guasi, solarisaio 等等。 fio 官网地址#xff1a;http://freecode.com/proj… FIO是测试IOPS的非常好的工具用来对硬件进行压力测试和验证支持13种不同的I/O引擎包括:sync,mmap, libaio, posixaio, SG v3, splice, null, network, syslet,guasi, solarisaio 等等。 fio 官网地址http://freecode.com/projects/fio FIO用法 随机读 fio -filename/dev/sdb1 -direct1 -iodepth1 -thread -rwrandread -ioenginepsync -bs16k -size200G -numjobs10-runtime1000 -group_reporting -namemytest 说明 filename/dev/sdb1 测试文件名称通常选择需要测试的盘的data目录。 direct1 测试过程绕过机器自带的buffer。使测试结果更真实。 rwrandwrite 测试随机写的I/O rwrandrw 测试随机写和读的I/O bs16k 单次io的块文件大小为16k bsrange512-2048 同上提定数据块的大小范围 size5g 本次的测试文件大小为5g以每次4k的io进行测试。 numjobs30 本次的测试线程为30. runtime1000 测试时间为1000秒如果不写则一直将5g文件分4k每次写完为止。 ioenginepsync io引擎使用pync方式 rwmixwrite30 在混合读写的模式下写占30% group_reporting 关于显示结果的汇总每个进程的信息。 这个工具最大的特点是使用简单支持的文件操作非常多, 可以覆盖到我们能见到的文件使用方式:syncBasic read(2) or write(2) I/O. fseek(2) is used to position the I/O location.psyncBasic pread(2) or pwrite(2) I/O.vsync: Basic readv(2) or writev(2) I/O. Will emulate queuing by coalescing adjacents iOS into a single submission.libaio: Linux native asynchronous I/O.posixaio: glibc POSIX asynchronous I/O using aio_read(3) and aio_write(3).mmap: File is memory mapped with mmap(2) and data copied using memcpy(3).splice splice(2) is used to transfer the data and vmsplice(2) to transfer data from user-space to the kernel.syslet-rw Use the syslet system calls to make regular read/write asynchronous.sgSCSI generic sg v3 I/O.net Transfer over the network. filename must be set appropriately to host/port’ regardless of data direction. If receiving,only the port argument is used.netsplice Like net, but uses splice(2) and vmsplice(2) to map data and send/receive.guasi The GUASI I/O engine is the Generic Userspace Asynchronous Syscall Interface approach to asycnronous I/O. 此外 lockmem1g 只使用1g内存进行测试。 zero_buffers 用0初始化系统buffer。 nrfiles8 每个进程生成文件的数量。 顺序读 fio -filename/dev/sdb1 -direct1 -iodepth1 -thread -rwread -ioenginepsync -bs16k -size200G -numjobs30 -runtime1000-group_reporting -namemytest 随机写 fio -filename/dev/sdb1 -direct1 -iodepth1 -thread -rwrandwrite -ioenginepsync -bs16k -size200G -numjobs30-runtime1000 -group_reporting -namemytest 顺序写 fio -filename/dev/sdb1 -direct1 -iodepth1 -thread -rwwrite -ioenginepsync -bs16k -size200G -numjobs30-runtime1000 -group_reporting -namemytest 混合随机读写 fio -filename/dev/sdb1 -direct1 -iodepth1 -thread -rwrandrw -rwmixread70 -ioenginepsync -bs16k -size200G-numjobs30 -runtime100 -group_reporting -namemytest -ioschedulernoop 转自http://blog.csdn.net/youngstonep/article/details/52315192 注意事项 使用fio工具测试磁盘iops后可能会导致磁盘下的文件损坏出现Structure needs cleaning错误。 解决办法会造成数据丢失参考以下链接 http://www.jb51.net/LINUXjishu/225992.html 今天在使用fio进行IO测试的时候文件系统/home分区遇到了mount: Structure needs cleaning 报错。大致情况 /home分区是xfs文件系统 执行fio进行多进程测试 测试完毕之后执行du -hs /home/*部分文件的数据提示 “mount: Structure needs cleaning”报错 解决方法 可以使用xfs_repair来修复但是要注意 xfs_repair修复的分区中的文件都会丢失即使是du能正常显示的文件也会丢失。 处理步骤 umount /home xfs_repair /home mount /home 挂载命令也可用 mount /dev/sdc1 /mnt/usbhd1 —— 第一个参数是设备号第二个参数是目录 该工具一定要谨慎使用损坏的数据目前还没办法恢复转载于:https://www.cnblogs.com/willdoop/p/7220747.html