[96] | 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" |
---|
[97] | 8 | local_zip="/var/log/${log_start}diskfull.tar.gz" |
---|
[96] | 9 | echo "0. Rebooting...." > $log_file |
---|
| 10 | echo "0. Rebooting...." |
---|
| 11 | /opt/drbl/sbin/dcs -h "$IP_LIST" local 2>&1 > $status_file |
---|
| 12 | source /home/jazz/.bash_aliases |
---|
| 13 | up-host-a > /root/.dsh/machines.list |
---|
| 14 | |
---|
| 15 | function mydsh() |
---|
| 16 | { |
---|
[97] | 17 | dsh -a -c "date > /var/log/$2.time.$1; /usr/bin/time -a -o /var/log/$2.time.$i $3; date >> /var/log/$2.time.$1" >> $status_file 2>&1 |
---|
[96] | 18 | } |
---|
| 19 | |
---|
| 20 | echo "START diskfull Benchmark ...." >> $log_file |
---|
[97] | 21 | for ((i=1;i<=10;i++)); do |
---|
[96] | 22 | echo "[$i] 1. Booting...." >> $log_file |
---|
| 23 | echo "[$i] 1. Booting...." |
---|
| 24 | dsh -a -c "reboot" 2>&1 >> $status_file |
---|
| 25 | `date >> $log_file` |
---|
| 26 | sleep 120 |
---|
| 27 | dsh -a -c "echo 3 > /proc/sys/vm/drop_caches" |
---|
| 28 | echo "[$i] 2. Running dd ...." >> $log_file |
---|
| 29 | echo "[$i] 2. Running dd ...." |
---|
| 30 | `date >> $log_file` |
---|
[97] | 31 | mydsh "$i" "dd" "dd if=/dev/zero of=/root/E2CC.img bs=1M count=1024" |
---|
[96] | 32 | `date >> $log_file` |
---|
| 33 | sleep 120 |
---|
| 34 | echo "[$i] 3. Running tar ...." >> $log_file |
---|
| 35 | echo "[$i] 3. Running tar ...." |
---|
| 36 | `date >> $log_file` |
---|
| 37 | mydsh "$i" "tar" "tar zcvf /root/E2CC.img.tar.gz /root/E2CC.img" |
---|
| 38 | `date >> $log_file` |
---|
| 39 | sleep 120 |
---|
| 40 | echo "[$i] 4. Running bonnie++ ...." >> $log_file |
---|
| 41 | echo "[$i] 4. Running bonnie++ ...." |
---|
| 42 | `date >> $log_file` |
---|
[98] | 43 | # force to run bonnie++ with 512MB RAM (-r), 1024MB (-s) |
---|
| 44 | mydsh "$i" "bonnie++" "bonnie++ -u root -d /root -r 512 -s 1024" |
---|
[96] | 45 | `date >> $log_file` |
---|
| 46 | sleep 120 |
---|
| 47 | echo "[$i] *. Download Kernel ...." >> $log_file |
---|
| 48 | echo "[$i] *. Download Kernel ...." |
---|
[97] | 49 | `date >> $log_file` |
---|
| 50 | 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 -o /tmp/linux-2.6.30.log" |
---|
| 51 | `date >> $log_file` |
---|
[96] | 52 | echo "[$i] *. Extract Kernel ...." >> $log_file |
---|
| 53 | echo "[$i] *. Extract Kernel ...." |
---|
[97] | 54 | `date >> $log_file` |
---|
| 55 | mydsh "$i" "extrac-kernel" "tar jxvf /tmp/linux-2.6.30.tar.bz2 -C /tmp; rm -f /tmp/linux-2.6.30.tar.bz2" |
---|
| 56 | `date >> $log_file` |
---|
| 57 | echo "[$i] *. Configure Kernel ...." >> $log_file |
---|
| 58 | echo "[$i] *. Configure Kernel ...." |
---|
| 59 | `date >> $log_file` |
---|
[96] | 60 | mydsh "$i" "make-allnoconf" "make -C /tmp/linux-2.6.30 allnoconfig" |
---|
[97] | 61 | `date >> $log_file` |
---|
[98] | 62 | echo "[$i] 5. Running make -j 1 twice ...." >> $log_file |
---|
| 63 | echo "[$i] 5. Running make -j 1 twice ...." |
---|
[96] | 64 | `date >> $log_file` |
---|
[97] | 65 | mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 66 | mydsh "$i-1" "make-j1" "make -j 1 -C /tmp/linux-2.6.30" |
---|
| 67 | mydsh "$i-2" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 68 | mydsh "$i-2" "make-j1" "make -j 1 -C /tmp/linux-2.6.30" |
---|
[96] | 69 | `date >> $log_file` |
---|
| 70 | sleep 120 |
---|
[98] | 71 | echo "[$i] 6. Running make -j 2 triple ...." >> $log_file |
---|
| 72 | echo "[$i] 6. Running make -j 2 triple ...." |
---|
[96] | 73 | `date >> $log_file` |
---|
[97] | 74 | mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 75 | mydsh "$i-1" "make-j2" "make -j 2 -C /tmp/linux-2.6.30" |
---|
| 76 | mydsh "$i-2" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 77 | mydsh "$i-2" "make-j2" "make -j 2 -C /tmp/linux-2.6.30" |
---|
| 78 | mydsh "$i-3" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 79 | mydsh "$i-3" "make-j2" "make -j 2 -C /tmp/linux-2.6.30" |
---|
[96] | 80 | `date >> $log_file` |
---|
| 81 | sleep 120 |
---|
[98] | 82 | echo "[$i] 7. Running make -j 3 triple ...." >> $log_file |
---|
| 83 | echo "[$i] 7. Running make -j 3 triple ...." |
---|
[96] | 84 | `date >> $log_file` |
---|
[97] | 85 | mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 86 | mydsh "$i-1" "make-j3" "make -j 3 -C /tmp/linux-2.6.30" |
---|
| 87 | mydsh "$i-2" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 88 | mydsh "$i-2" "make-j3" "make -j 3 -C /tmp/linux-2.6.30" |
---|
| 89 | mydsh "$i-3" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 90 | mydsh "$i-3" "make-j3" "make -j 3 -C /tmp/linux-2.6.30" |
---|
[96] | 91 | `date >> $log_file` |
---|
| 92 | sleep 120 |
---|
[98] | 93 | echo "[$i] 8. Running make -j 4 triple ...." >> $log_file |
---|
| 94 | echo "[$i] 8. Running make -j 4 triple ...." |
---|
[96] | 95 | `date >> $log_file` |
---|
[97] | 96 | mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 97 | mydsh "$i-1" "make-j4" "make -j 4 -C /tmp/linux-2.6.30" |
---|
| 98 | mydsh "$i-2" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 99 | mydsh "$i-2" "make-j4" "make -j 4 -C /tmp/linux-2.6.30" |
---|
| 100 | mydsh "$i-3" "make-clean" "make clean -C /tmp/linux-2.6.30" |
---|
| 101 | mydsh "$i-3" "make-j4" "make -j 4 -C /tmp/linux-2.6.30" |
---|
[96] | 102 | `date >> $log_file` |
---|
| 103 | done |
---|
[97] | 104 | mydsh "F" "collect" "tar zcvf $local_zip /var/log/*.time.*" |
---|