1 | #!/bin/bash |
---|
2 | IP_LIST="192.168.100.1 192.168.100.2 192.168.100.4 192.168.100.5 192.168.100.11 192.168.100.12 192.168.100.13 192.168.100.14 192.168.100.21 192.168.100.22 192.168.100.24 192.168.100.25" |
---|
3 | export LANG=en_US |
---|
4 | export LC_ALL=en_US |
---|
5 | log_start=$(date +"%y%m%d-%H%M%S_") |
---|
6 | log_file="/var/log/${log_start}diskfull-benchmark.log" |
---|
7 | status_file="/var/log/${log_start}diskfull-benchmark-status.log" |
---|
8 | echo "0. Rebooting...." > $log_file |
---|
9 | echo "0. Rebooting...." |
---|
10 | /opt/drbl/sbin/dcs -h "$IP_LIST" local 2>&1 > $status_file |
---|
11 | source /home/jazz/.bash_aliases |
---|
12 | up-host-a > /root/.dsh/machines.list |
---|
13 | |
---|
14 | function mydsh() |
---|
15 | { |
---|
16 | dsh -a -c "date > /var/log/$2.time.$1; /usr/bin/time -o /var/log/$2.time $3; cat /var/log/$2.time >> /var/log/$2.time.$1; date >> /var/log/$2.time.$1" 2>&1 >> $status_file |
---|
17 | } |
---|
18 | |
---|
19 | echo "START diskfull Benchmark ...." >> $log_file |
---|
20 | for ((i=1;i<=1;i++)); do |
---|
21 | echo "[$i] 1. Booting...." >> $log_file |
---|
22 | echo "[$i] 1. Booting...." |
---|
23 | dsh -a -c "reboot" 2>&1 >> $status_file |
---|
24 | `date >> $log_file` |
---|
25 | sleep 120 |
---|
26 | dsh -a -c "echo 3 > /proc/sys/vm/drop_caches" |
---|
27 | echo "[$i] 2. Running dd ...." >> $log_file |
---|
28 | echo "[$i] 2. Running dd ...." |
---|
29 | `date >> $log_file` |
---|
30 | mydsh "$i" "dd" "dd if=/dev/zero of=/root/E2CC.img bs=1M count=500" |
---|
31 | `date >> $log_file` |
---|
32 | sleep 120 |
---|
33 | echo "[$i] 3. Running tar ...." >> $log_file |
---|
34 | echo "[$i] 3. Running tar ...." |
---|
35 | `date >> $log_file` |
---|
36 | mydsh "$i" "tar" "tar zcvf /root/E2CC.img.tar.gz /root/E2CC.img" |
---|
37 | `date >> $log_file` |
---|
38 | sleep 120 |
---|
39 | echo "[$i] 4. Running bonnie++ ...." >> $log_file |
---|
40 | echo "[$i] 4. Running bonnie++ ...." |
---|
41 | `date >> $log_file` |
---|
42 | mydsh "$i" "bonnie++" "bonnie++ -u root -d /root -s 500" |
---|
43 | `date >> $log_file` |
---|
44 | sleep 120 |
---|
45 | echo "[$i] *. Download Kernel ...." >> $log_file |
---|
46 | echo "[$i] *. Download Kernel ...." |
---|
47 | mydsh "$i" "download-kernel" "wget -O /tmp/linux-2.6.30.tar.bz2 http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.bz2" |
---|
48 | echo "[$i] *. Extract Kernel ...." >> $log_file |
---|
49 | echo "[$i] *. Extract Kernel ...." |
---|
50 | mydsh "$i" "extrac-kernel" "tar jxvf /tmp/linux-2.6.30.tar.bz2 -C /tmp" |
---|
51 | mydsh "$i" "make-allnoconf" "make -C /tmp/linux-2.6.30 allnoconfig" |
---|
52 | echo "[$i] 5. Running make -j 1 ...." >> $log_file |
---|
53 | echo "[$i] 5. Running make -j 1 ...." |
---|
54 | mydsh "$i" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
55 | `date >> $log_file` |
---|
56 | mydsh "$i" "make-j1" "make -j 1 -C /tmp/linux-2.6.30" |
---|
57 | `date >> $log_file` |
---|
58 | sleep 120 |
---|
59 | echo "[$i] 6. Running make -j 2 ...." >> $log_file |
---|
60 | echo "[$i] 6. Running make -j 2 ...." |
---|
61 | mydsh "$i" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
62 | `date >> $log_file` |
---|
63 | mydsh "$i" "make-j2" "make -j 2 -C /tmp/linux-2.6.30" |
---|
64 | `date >> $log_file` |
---|
65 | sleep 120 |
---|
66 | echo "[$i] 7. Running make -j 3 ...." >> $log_file |
---|
67 | echo "[$i] 7. Running make -j 3 ...." |
---|
68 | mydsh "$i" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
69 | `date >> $log_file` |
---|
70 | mydsh "$i" "make-j3" "make -j 3 -C /tmp/linux-2.6.30" |
---|
71 | `date >> $log_file` |
---|
72 | sleep 120 |
---|
73 | echo "[$i] 8. Running make -j 4 ...." >> $log_file |
---|
74 | echo "[$i] 8. Running make -j 4 ...." |
---|
75 | mydsh "$i" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
76 | `date >> $log_file` |
---|
77 | mydsh "$i" "make-j4" "make -j 4 -C /tmp/linux-2.6.30" |
---|
78 | `date >> $log_file` |
---|
79 | done |
---|