-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest-stability.sh
72 lines (64 loc) · 1.85 KB
/
test-stability.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# set -x
deconfigramdisk() {
dmsetup remove fcdev
rmmod dm_foolcache
losetup -d /dev/loop0 /dev/loop1
rm slow ram/fast
umount ram
rmdir ram
}
configramdisk() {
size=`expr $1 \* 2097152`
fcbs=$2
mkdir ram
mount none ram -t tmpfs -o size=90%
dd if=/dev/zero of=ram/fast bs=512 count=0 seek=${size}
dd if=/dev/zero of=slow bs=512 count=0 seek=${size}
losetup /dev/loop0 slow
losetup /dev/loop1 ram/fast
insmod ./dm-foolcache.ko
echo "0 $size foolcache /dev/loop0 /dev/loop1 $fcbs create" | dmsetup create fcdev
}
deconfigzero() {
dmsetup remove fcdev
dmsetup remove fast
dmsetup remove slow
rmmod dm_foolcache
}
configzero() {
size=`expr $1 \* 2097152`
fcbs=$2
modprobe dm-zero
insmod ./dm-foolcache.ko
echo "0 $size zero" | dmsetup create fast
echo "0 $size zero" | dmsetup create slow
echo "0 $size foolcache /dev/mapper/slow /dev/mapper/fast $fcbs create" | dmsetup create fcdev
}
config() {
size=${1:-10} # 8GB size by default
fcbs=${2:-1024} # 1MB block size by default
configzero $size $fcbs
}
deconfig() {
deconfigzero
}
vsize=8 #GB
deconfig
threads=`cat /proc/cpuinfo | grep processor | wc -l`
echo -n "Found $threads hardware threads, "
threads=`expr $threads \* 2`
echo "will spawn $threads threads for each following test."
# for fcbs in 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
for fcbs in 256 512 1024 2048 4096 8192 16384 32768
do
for fiobs in 512 1k 2k 4k 8k 16k 32k 64k 128k 256k 512k 1024k 2048k 4096k
# for fiobs in 1024k 2048k 4096k
do
echo "********************** volume size = $vsize GB, fcbs = $fcbs KB, fiobs = $fiobs *********************************"
config $vsize $fcbs
fio --filename=/dev/mapper/fcdev --direct=1 --thread --iodepth 128 --thread --rw=randread --ioengine=libaio --size=100% --numjobs=$threads --bs=$fiobs --group_reporting --name=mytest
cat /proc/foolcache/*
deconfig
sync
done
done