-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdiskPerformance.sh
More file actions
executable file
·94 lines (79 loc) · 3.05 KB
/
diskPerformance.sh
File metadata and controls
executable file
·94 lines (79 loc) · 3.05 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
today=`date +%Y-%m-%d.%H:%M:%S` # or whatever pattern you desire
#Usage function
function usage()
{
echo ""
echo
echo "Disk Performance tests using fio."
echo "required: fio installed"
echo "redhat:"
echo "yum makecache fastcache && yum install fio "
echo "centos: "
echo "yum makecache fastcache && yum install fio"
echo "suse:"
echo "https://software.opensuse.org/download.html?project=home%3Amalcolmlewis%3ASLE_12_General&package=fio"
echo "ubuntu: "
echo "apt-get update && apt-get install fio"
exit
}
# Function for user to verify their selections
function selections()
{
echo Your selections:
echo Disk mount point: $disk
echo Filename: $fileName
echo output filesize: $outFile
echo y = Continue, n = Start over & read answer
if [[ $answer == "y" ]]; then
echo Continuing.
sleep .5
elif [[ $answer == "n" ]]; then
echo Starting over
sleep 1
eval "./performance.sh"
elif [[ $answer != "y" || "$answer" != "y" || -z "$answer" ]]; then
echo You must select Y or N
exit 1
fi
}
# This is the iostat function for tracking io statistics
function ioStat()
{
iostat -dmtz 1 75 >>iostat.$today &
rm -rf $disk/$fileName
echo " rm -f $disk/$fileName"
}
#Fio function for the disk read write test.
function Fio()
{
#fio -filename=$disk/$fileName -iodepth=64 -ioengine=libaio -direct=1 -rw=randwrite -bs=64k -size=$outFile"G" -numjobs=64 -runtime=60 -group_reporting -name=test-randwrite >>fio-test-write.$today &
fio -filename=$disk/$fileName -iodepth=64 -ioengine=libaio -direct=1 -rw=randwrite -bs=4k -size=$outFile"G" -numjobs=5 -runtime=60 -group_reporting -name=test-randwrite >>fio-test-write.$today &
# fio -filename=$disk/$fileName -iodepth=64 -ioengine=libaio -direct=1 -rw=randwrite -bs=64k -size=$outFile"G" -numjobs=64 -runtime=60 -group_reporting -name=test-randread >>fio-test-read.$today &
fio -filename=$disk/$fileName -iodepth=64 -ioengine=libaio -direct=1 -rw=randwrite -bs=4k -size=$outFile"G" -numjobs=5 -runtime=60 -group_reporting -name=test-randread >>fio-test-read.$today &
}
clear
echo "####################################################"
echo "# Performance testing with fio #"
echo "# #"
echo "# v:0.1 #"
echo "# 2018/7/5 #"
echo "# Press h, help or ? anytime for usage and #"
echo "# Fio install instructions. #"
echo "####################################################"
#Selection input by user
echo Disk mount point:&read disk
if [[ $disk = "?" || $disk == "help" || $disk == "h" ]]; then
usage
fi
#read rg
echo Write filename: &read fileName
if [[ $fileName == "?" || $fileName == "help" || $fileName == "h" ]]; then
usage
fi
echo output filesize [GB]: &read outFile
if [[ $outFile == "?" || $outFile == "help" || $outfile == "h" ]]; then
usage
fi
ioStat
Fio