用一个脚本,在Linux下跑n个nvme盘记录
1.在Linux系统下创建0-11 的名称总共12个文件夹命令
for i in {0..11}; do mkdir "$i"; done
2.给脚本执行的权限,再去Linux终端修改脚本里面的device=/dev/nvme0n1对应到文件夹数字再复制到对应的文件夹下
for i in {0..11}; do sed "s|device=/dev/nvme0n1|device=/dev/nvme${i}n1|g" CT_ssd_performance_202305.sh > "$i/CT_ssd_performance_202305_${i}.sh"; done
3.给所有脚本执行的权限
for i in {0..11}; do chmod +x "$i/CT_ssd_performance_202305_${i}.sh"; done
4.同时运行上面的十二个脚本
for i in {0..11}; do cd "$i" && nohup ./CT_ssd_performance_202305_${i}.sh & cd ..; done(慎用,出现过卡死情况)
附件脚本内容
#!/bin/bash
device=/dev/nvme0n1
#the numa and core of the nvme SSD depends on where the SSD is placed,please change them according to your system.
numa=0
numa1=0
core=0-31
#清空测试盘数据,以下nvme-cli工具命令:
nvme format $device
#Script of precondition:4K IOPS
nohup nmon -f -s 2 -c 6000 -F pre-IOPS.nmon &
fio --ioengine=libaio --direct=1 --thread --norandommap --filename=$device --name=init_seq --output=init_seq.log --rw=write --bs=1m --numjobs=1 --iodepth=64 --loops=2
fio --ioengine=libaio --direct=1 --thread --random_generator=tausworthe64 --norandommap --filename=$device --name=init_rand --output=init_rand.log --rw=randwrite --bs=4k --numjobs=8 --iodepth=32 --ramp_time=60 --runtime=14400 --time_based --group_reporting --random_generator=tausworthe64
#Script of precondition:latency
#core is parameter of taskset command,which is one core of the numa node where the PCIe SSD is placed
#4k Random Read latency
nohup nmon -f -s 2 -c 1000 -F Latency_RandomRead.nmon &
fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --group_reporting --name=mytest --ramp_time=180 --runtime=1800 --time_based --numjobs=1 --iodepth=1 --filename=$device --rw=randread --bs=4k --output=4K_randR_latency.log --random_generator=tausworthe64
#4k Random Write latency
nohup nmon -f -s 2 -c 1000 -F Latency_RandomWrite.nmon &
fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --group_reporting --name=mytest --ramp_time=180 --runtime=1800 --time_based --numjobs=1 --iodepth=1 --filename=$device --rw=randwrite --bs=4k --output=4K_randW_latency.log --random_generator=tausworthe64
sleep 180s
#4k Random Read 8x256
nohup nmon -f -s 2 -c 1900 -F RandomRead.nmon &
fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --group_reporting --name=mytest --ramp_time=180 --runtime=3600 --time_based --numjobs=8 --iodepth=256 --filename=$device --rw=randread --bs=4k --output=4K_randR256.log --random_generator=tausworthe64
#4k Random Write
nohup nmon -f -s 2 -c 1900 -F RandomWrite.nmon &
fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --group_reporting --name=mytest --ramp_time=180 --runtime=3600 --time_based --numjobs=8 --iodepth=256 --filename=$device --rw=randwrite --bs=4k --output=4K_randW256.log --random_generator=tausworthe64
sleep 180s
#4k Random Read 8X64
nohup nmon -f -s 2 -c 1900 -F RandomRead.nmon &
fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --group_reporting --name=mytest --ramp_time=180 --runtime=3600 --time_based --numjobs=8 --iodepth=64 --filename=$device --rw=randread --bs=4k --output=4K_randR64.log --random_generator=tausworthe64
#4k Random Write
nohup nmon -f -s 2 -c 1900 -F RandomWrite.nmon &
fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --group_reporting --name=mytest --ramp_time=180 --runtime=3600 --time_based --numjobs=8 --iodepth=64 --filename=$device --rw=randwrite --bs=4k --output=4K_randW64.log --random_generator=tausworthe64
sleep 180s
#4k Random Read 8X512
nohup nmon -f -s 2 -c 1900 -F RandomRead.nmon &
fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --group_reporting --name=mytest --ramp_time=180 --runtime=3600 --time_based --numjobs=8 --iodepth=512 --filename=$device --rw=randread --bs=4k --output=4K_randR512.log --random_generator=tausworthe64
#4k Random Write
nohup nmon -f -s 2 -c 1900 -F RandomWrite.nmon &
fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --group_reporting --name=mytest --ramp_time=180 --runtime=3600 --time_based --numjobs=8 --iodepth=512 --filename=$device --rw=randwrite --bs=4k --output=4K_randW512.log --random_generator=tausworthe64
sleep 180s
#Script of precondition:Bandwidth
nohup nmon -f -s 2 -c 3600 -F pre-bandwidth.nmon &
fio --ioengine=libaio --direct=1 --thread --norandommap --filename=$device --name=init_seq2 --output=init_seq2.log --rw=write --bs=1m --numjobs=1 --iodepth=256 --loops=2
#1m Seq Read
nohup nmon -f -s 2 -c 1900 -F SeqRead.nmon &
fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --stonewall --group_reporting --name=mytest --ramp_time=180 --runtime=3600 --time_based --numjobs=1 --iodepth=128 --filename=$device --rw=read --bs=128k --output=128k_seqR.log
#1m Seq Write
nohup nmon -f -s 2 -c 1900 -F SeqWrite.nmon &
fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --stonewall --group_reporting --name=mytest --ramp_time=180 --runtime=3600 --time_based --numjobs=1 --iodepth=128 --filename=$device --rw=write --bs=128k --output=128k_seqW.log

浙公网安备 33010602011771号