source: drbl-green-benchmark/diskfull-benchmark.sh @ 117

Last change on this file since 117 was 101, checked in by jazz, 15 years ago
  • add hostname to local_zip filename
  • Property svn:executable set to *
File size: 3.9 KB
RevLine 
[96]1#!/bin/bash
2IP_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"
3export LANG=en_US
4export LC_ALL=en_US
5log_start=$(date +"%y%m%d-%H%M%S_")
[101]6hostname=$(hostname)
[100]7log_file="/root/log/${log_start}diskfull-benchmark.log"
[101]8status_file="/root/log/${log_start}diskfull-benchmark-status.log"
[99]9status_file="/dev/null"
[101]10local_zip="/root/log/${log_start}${hostname}_diskfull.tar.gz"
[96]11echo "0. Rebooting...." > $log_file
12echo "0. Rebooting...."
[99]13/opt/drbl/sbin/dcs -h "$IP_LIST" local > $status_file 2>&1
[96]14source /home/jazz/.bash_aliases
15up-host-a > /root/.dsh/machines.list
[99]16rm -f /root/.ssh/known_hosts
[100]17mkdir -p /root/log/
[96]18
19function mydsh()
20{
[100]21  dsh -a -c "date > /root/log/$2.time.$1; /usr/bin/time -a -o /root/log/$2.time.$i $3; date >> /root/log/$2.time.$1" >> $status_file 2>&1
[96]22}
23
24echo "START diskfull Benchmark ...." >> $log_file
[97]25for ((i=1;i<=10;i++)); do
[96]26  echo "[$i] 1. Booting...." >> $log_file
27  echo "[$i] 1. Booting...."
[99]28  dsh -a -c "reboot" >> $status_file 2>&1
[96]29  `date >> $log_file`
30  sleep 120
31  dsh -a -c "echo 3 > /proc/sys/vm/drop_caches"
32  echo "[$i] 2. Running dd ...." >> $log_file
33  echo "[$i] 2. Running dd ...."
34  `date >> $log_file`
[97]35  mydsh "$i" "dd" "dd if=/dev/zero of=/root/E2CC.img bs=1M count=1024"
[96]36  `date >> $log_file`
37  sleep 120
38  echo "[$i] 3. Running tar ...." >> $log_file
39  echo "[$i] 3. Running tar ...."
40  `date >> $log_file`
41  mydsh "$i" "tar" "tar zcvf /root/E2CC.img.tar.gz /root/E2CC.img"
42  `date >> $log_file`
43  sleep 120
44  echo "[$i] 4. Running bonnie++ ...." >> $log_file
45  echo "[$i] 4. Running bonnie++ ...."
46  `date >> $log_file`
[99]47  # force to run bonnie++ with 128MB RAM (-r), 256MB (-s)
48  mydsh "$i" "bonnie++" "bonnie++ -u root -d /root -r 128 -s 256"
[96]49  `date >> $log_file`
50  sleep 120
51  echo "[$i] *. Download Kernel ...." >> $log_file
52  echo "[$i] *. Download Kernel ...."
[97]53  `date >> $log_file`
54  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"
55  `date >> $log_file`
[96]56  echo "[$i] *. Extract Kernel ...." >> $log_file
57  echo "[$i] *. Extract Kernel ...."
[97]58  `date >> $log_file`
59  mydsh "$i" "extrac-kernel" "tar jxvf /tmp/linux-2.6.30.tar.bz2 -C /tmp; rm -f /tmp/linux-2.6.30.tar.bz2"
60  `date >> $log_file`
61  echo "[$i] *. Configure Kernel ...." >> $log_file
62  echo "[$i] *. Configure Kernel ...."
63  `date >> $log_file`
[96]64  mydsh "$i" "make-allnoconf" "make -C /tmp/linux-2.6.30 allnoconfig"
[97]65  `date >> $log_file`
[99]66  echo "[$i] 5. Running make -j 1 once ...." >> $log_file
67  echo "[$i] 5. Running make -j 1 once ...."
[96]68  `date >> $log_file`
[97]69  mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30"
70  mydsh "$i-1" "make-j1" "make -j 1 -C /tmp/linux-2.6.30"
[96]71  `date >> $log_file`
72  sleep 120
[99]73  echo "[$i] 6. Running make -j 2 once ...." >> $log_file
74  echo "[$i] 6. Running make -j 2 once ...."
[96]75  `date >> $log_file`
[97]76  mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30"
77  mydsh "$i-1" "make-j2" "make -j 2 -C /tmp/linux-2.6.30"
[96]78  `date >> $log_file`
79  sleep 120
[99]80  echo "[$i] 7. Running make -j 3 twice ...." >> $log_file
81  echo "[$i] 7. Running make -j 3 twice ...."
[96]82  `date >> $log_file`
[97]83  mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30"
84  mydsh "$i-1" "make-j3" "make -j 3 -C /tmp/linux-2.6.30"
85  mydsh "$i-2" "make-clean" "make clean -C /tmp/linux-2.6.30"
86  mydsh "$i-2" "make-j3" "make -j 3 -C /tmp/linux-2.6.30"
[96]87  `date >> $log_file`
88  sleep 120
[99]89  echo "[$i] 8. Running make -j 4 twice ...." >> $log_file
90  echo "[$i] 8. Running make -j 4 twice ...."
[96]91  `date >> $log_file`
[97]92  mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30"
93  mydsh "$i-1" "make-j4" "make -j 4 -C /tmp/linux-2.6.30"
94  mydsh "$i-2" "make-clean" "make clean -C /tmp/linux-2.6.30"
95  mydsh "$i-2" "make-j4" "make -j 4 -C /tmp/linux-2.6.30"
[96]96  `date >> $log_file`
97done
[100]98mydsh "F" "collect" "tar zcvf $local_zip /root/log/*.time.*"
Note: See TracBrowser for help on using the repository browser.