• 沒有找到結果。

fio是一个开源的I/O压力测试工具,可以使用fio工具对SFS进行吞吐量和IOPS的性能测 试。

前提条件

已在云服务器上安装fio工具。fio可从官网或GitHub下载。

注意和说明

测试性能依赖client和server之间的网络带宽及文件系统的容量大小。

安装 fio

以Linux CentOS系统为例说明:

1. 在官网下载fio。

yum install fio 2. 安装libaio引擎。

yum install libaio-devel 3. 查看fio版本。

fio --version

文件系统性能数据

SFS Turbo文件系统的性能主要有IOPS和吞吐量等指标,具体各指标数据参见表

11-1。

参数 SFS Turbo标准型 SFS Turbo性能型

最大IOPS 5000 20000

最大吞吐量 150 MB/s 350 MB/s IOPS性能计算公式 IOPS = min (5000, 1200 + 6

× 容量) IOPS = min (20000, 1500 + 20 × 容量)

IOPS性能计算公式举例说明

● 单个文件系统IOPS性能 =“最大IOPS”与“基线IOPS + 每GB文件系统的IOPS × 文件系统容量”的最小值。

以SFS Turbo性能型文件系统为例,单个SFS Turbo性能型文件系统的最大IOPS为 20000。

– 假如SFS Turbo性能型文件系统容量为500 GB,则该文件系统IOPS性能 = min (20000, 1500 + 20 × 500 ),取20000与11500中的最小值,即该文件系 统的IOPS性能为11500。

– 假如SFS Turbo性能型文件系统容量为1000 GB,则该文件系统IOPS性能 = min (20000, 1500 + 20 × 1000 ),取20000与21500中的最小值,即该文件 系统的IOPS性能为20000。

本文以SFS Turbo性能型,云服务器规格如下为例说明。

规格:通用计算增强型 | c3.xlarge.4 | 4vCPUs | 16GB 镜像:CentOS 7.564bit

混合读写,读写比例7:3

● fio命令:

fio randrepeat=1 ioengine=libaio name=test -output=output.log --direct=1 --filename=

/mnt/nfs/test_fio

bs=4k iodepth=128

--size=10240M --readwrite=rw --rwmixwrite=30 --fallocate=none 说明

其中,“/mnt/nfs/test_fio”为待测试的目标文件的挂载路径,需具体到文件名,即这里

要测试的是“/mnt/nfs”目录下的“test_fio”文件,请根据实际填写。

● fio结果:

混合读写,读写比例3:7

● fio命令:

fio randrepeat=1 ioengine=libaio name=test -output=output.log --direct=1 --filename=

/mnt/nfs/test_fio

bs=4k iodepth=128

--size=10240M --readwrite=rw --rwmixwrite=70 --fallocate=none 说明

其中,“/mnt/nfs/test_fio”为待测试的目标文件的挂载路径,需具体到文件名,即这里

要测试的是“/mnt/nfs”目录下的“test_fio”文件,请根据实际填写。

● fio结果:

顺序读IOPS

● fio命令:

fio randrepeat=1 ioengine=libaio name=test -output=output.log --direct=1 --filename=

/mnt/sfs-turbo/test_fio

bs=4k iodepth=128 --size=10240M --readwrite=read --fallocate=none

说明

其中,“/mnt/sfs-turbo/test_fio”为待测试的目标文件的挂载路径,需具体到文件名,

即这里要测试的是“/mnt/sfs-turbo”目录下的“test_fio”文件,请根据实际填写。

● fio结果:

随机读IOPS

● fio命令:

fio randrepeat=1 ioengine=libaio name=test -output=output.log --direct=1 --filename=

/mnt/sfs-turbo/test_fio

bs=4k iodepth=128 --size=10240M --readwrite=randread --fallocate=none

说明

其中,“/mnt/sfs-turbo/test_fio”为待测试的目标文件的挂载路径,需具体到文件名,

即这里要测试的是“/mnt/sfs-turbo”目录下的“test_fio”文件,请根据实际填写。

● fio结果:

顺序写IOPS

● fio命令:

fio randrepeat=1 ioengine=libaio name=test -output=output.log --direct=1 --filename=

/mnt/sfs-turbo/test_fio

bs=4k iodepth=128 --size=10240M --readwrite=write --fallocate=none

说明

其中,“/mnt/sfs-turbo/test_fio”为待测试的目标文件的挂载路径,需具体到文件名,

即这里要测试的是“/mnt/sfs-turbo”目录下的“test_fio”文件,请根据实际填写。

● fio结果:

随机写IOPS

● fio命令:

说明

其中,“/mnt/sfs-turbo/test_fio”为待测试的目标文件的挂载路径,需具体到文件名,

即这里要测试的是“/mnt/sfs-turbo”目录下的“test_fio”文件,请根据实际填写。

● fio结果:

顺序读带宽

● fio命令:

fio randrepeat=1 ioengine=libaio name=test -output=output.log --direct=1 --filename=

/mnt/sfs-turbo/test_fio

bs=1M iodepth=128 --size=10240M --readwrite=read --fallocate=none

说明

其中,“/mnt/sfs-turbo/test_fio”为待测试的目标文件的挂载路径,需具体到文件名,

即这里要测试的是“/mnt/sfs-turbo”目录下的“test_fio”文件,请根据实际填写。

● fio结果:

随机读带宽

● fio命令:

fio randrepeat=1 ioengine=libaio name=test -output=output.log --direct=1 --filename=

/mnt/sfs-turbo/test_fio

bs=1M iodepth=128 --size=10240M --readwrite=randread --fallocate=none

说明

其中,“/mnt/sfs-turbo/test_fio”为待测试的目标文件的挂载路径,需具体到文件名,

即这里要测试的是“/mnt/sfs-turbo”目录下的“test_fio”文件,请根据实际填写。

● fio结果:

顺序写带宽

● fio命令:

fio randrepeat=1 ioengine=libaio name=test -output=output.log --direct=1 --filename=

/mnt/sfs-turbo/test_fio

bs=1M iodepth=128 --size=10240M --readwrite=write --fallocate=none

说明

其中,“/mnt/sfs-turbo/test_fio”为待测试的目标文件的挂载路径,需具体到文件名,

即这里要测试的是“/mnt/sfs-turbo”目录下的“test_fio”文件,请根据实际填写。

● fio结果:

● fio命令:

fio randrepeat=1 ioengine=libaio name=test -output=output.log --direct=1 --filename=

/mnt/sfs-turbo/test_fio

bs=1M iodepth=128 --size=10240M --readwrite=randwrite --fallocate=none

说明

其中,“/mnt/sfs-turbo/test_fio”为待测试的目标文件的挂载路径,需具体到文件名,

即这里要测试的是“/mnt/sfs-turbo”目录下的“test_fio”文件,请根据实际填写。

● fio结果:

11.2 使用非 root 的普通用户挂载文件系统到 Linux 云服务

使用场景

Linux操作系统的弹性云服务器默认只能通过root帐号使用mount命令进行挂载文件系 统,但可通过赋予其他普通用户root权限,达到使非root的普通用户能够在弹性云服务

相關文件