automatic disk performance test

mkdir like test_case1, copy three files below in it:

test_case1/test.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/python3
import os
 
def shell_run(name, cmd):
	os.system('mkdir result')
	os.system(cmd + '> ./result/' + name)
 
def run_cmds(cmds):
	for name, cmd in cmds.items():
		shell_run(name, cmd)
 
cmds = {
	'1_small_read'		: 'fio -name iops -rw=read -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_small_randread'	: 'fio -name iops -rw=randread -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_small_write'		: 'fio -name iops -rw=write -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_small_randwrite'	: 'fio -name iops -rw=randwrite -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_big_read'		: 'fio -name iops -rw=read -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_big_randread'	: 'fio -name iops -rw=randread -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_big_write'		: 'fio -name iops -rw=write -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_big_randwrite'	: 'fio -name iops -rw=randwrite -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'4_small_read'		: 'fio -name iops -rw=read -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_small_randread'	: 'fio -name iops -rw=randread -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_small_write'		: 'fio -name iops -rw=write -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_small_randwrite'	: 'fio -name iops -rw=randwrite -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_big_read'		: 'fio -name iops -rw=read -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_big_randread'	: 'fio -name iops -rw=randread -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_big_write'		: 'fio -name iops -rw=write -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_big_randwrite'	: 'fio -name iops -rw=randwrite -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4'
}
run_cmds(cmds)

test_case1/parse.cpp

Read more