#!/bin/bash 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" export LANG=en_US export LC_ALL=en_US log_start=$(date +"%y%m%d-%H%M%S_") hostname=$(hostname) log_file="/root/log/${log_start}diskfull-benchmark.log" status_file="/root/log/${log_start}diskfull-benchmark-status.log" status_file="/dev/null" local_zip="/root/log/${log_start}${hostname}_diskfull.tar.gz" echo "0. Rebooting...." > $log_file echo "0. Rebooting...." /opt/drbl/sbin/dcs -h "$IP_LIST" local > $status_file 2>&1 source /home/jazz/.bash_aliases up-host-a > /root/.dsh/machines.list rm -f /root/.ssh/known_hosts mkdir -p /root/log/ function mydsh() { 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 } echo "START diskfull Benchmark ...." >> $log_file for ((i=1;i<=10;i++)); do echo "[$i] 1. Booting...." >> $log_file echo "[$i] 1. Booting...." dsh -a -c "reboot" >> $status_file 2>&1 `date >> $log_file` sleep 120 dsh -a -c "echo 3 > /proc/sys/vm/drop_caches" echo "[$i] 2. Running dd ...." >> $log_file echo "[$i] 2. Running dd ...." `date >> $log_file` mydsh "$i" "dd" "dd if=/dev/zero of=/root/E2CC.img bs=1M count=1024" `date >> $log_file` sleep 120 echo "[$i] 3. Running tar ...." >> $log_file echo "[$i] 3. Running tar ...." `date >> $log_file` mydsh "$i" "tar" "tar zcvf /root/E2CC.img.tar.gz /root/E2CC.img" `date >> $log_file` sleep 120 echo "[$i] 4. Running bonnie++ ...." >> $log_file echo "[$i] 4. Running bonnie++ ...." `date >> $log_file` # force to run bonnie++ with 128MB RAM (-r), 256MB (-s) mydsh "$i" "bonnie++" "bonnie++ -u root -d /root -r 128 -s 256" `date >> $log_file` sleep 120 echo "[$i] *. Download Kernel ...." >> $log_file echo "[$i] *. Download Kernel ...." `date >> $log_file` 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" `date >> $log_file` echo "[$i] *. Extract Kernel ...." >> $log_file echo "[$i] *. Extract Kernel ...." `date >> $log_file` mydsh "$i" "extrac-kernel" "tar jxvf /tmp/linux-2.6.30.tar.bz2 -C /tmp; rm -f /tmp/linux-2.6.30.tar.bz2" `date >> $log_file` echo "[$i] *. Configure Kernel ...." >> $log_file echo "[$i] *. Configure Kernel ...." `date >> $log_file` mydsh "$i" "make-allnoconf" "make -C /tmp/linux-2.6.30 allnoconfig" `date >> $log_file` echo "[$i] 5. Running make -j 1 once ...." >> $log_file echo "[$i] 5. Running make -j 1 once ...." `date >> $log_file` mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30" mydsh "$i-1" "make-j1" "make -j 1 -C /tmp/linux-2.6.30" `date >> $log_file` sleep 120 echo "[$i] 6. Running make -j 2 once ...." >> $log_file echo "[$i] 6. Running make -j 2 once ...." `date >> $log_file` mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30" mydsh "$i-1" "make-j2" "make -j 2 -C /tmp/linux-2.6.30" `date >> $log_file` sleep 120 echo "[$i] 7. Running make -j 3 twice ...." >> $log_file echo "[$i] 7. Running make -j 3 twice ...." `date >> $log_file` mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30" mydsh "$i-1" "make-j3" "make -j 3 -C /tmp/linux-2.6.30" mydsh "$i-2" "make-clean" "make clean -C /tmp/linux-2.6.30" mydsh "$i-2" "make-j3" "make -j 3 -C /tmp/linux-2.6.30" `date >> $log_file` sleep 120 echo "[$i] 8. Running make -j 4 twice ...." >> $log_file echo "[$i] 8. Running make -j 4 twice ...." `date >> $log_file` mydsh "$i-1" "make-clean" "make clean -C /tmp/linux-2.6.30" mydsh "$i-1" "make-j4" "make -j 4 -C /tmp/linux-2.6.30" mydsh "$i-2" "make-clean" "make clean -C /tmp/linux-2.6.30" mydsh "$i-2" "make-j4" "make -j 4 -C /tmp/linux-2.6.30" `date >> $log_file` done mydsh "F" "collect" "tar zcvf $local_zip /root/log/*.time.*"