Update some benchmark-running scripts
[bluesky.git] / microbench / run2.sh
1 #!/bin/bash
2
3 PARAMS="BLUESKY_RUN_NAME BLUESKY_CACHE_SIZE BLUESKY_TARGET BENCH_DURATION BENCH_FILESIZE BENCH_FILECOUNT BENCH_WRITERATIO BENCH_THREADS BENCH_OPS BENCH_INTERVALS BENCH_DIRSIZE BENCH_BLOCKSIZE NFS_BLOCKSIZE"
4
5 BLUESKY_RUN_NAME=$(date +%Y%m%d)-$$
6 BENCHER=c09-44.sysnet.ucsd.edu
7 PROXY=c09-45.sysnet.ucsd.edu
8
9 SSH_ARGS="-i $HOME/.ssh/id_bluesky"
10
11 get_params() {
12     for p in $PARAMS; do
13         if [ -n "${!p}" ]; then
14             echo "$p=${!p}"
15         fi
16     done
17 }
18
19 run_cmd() {
20     host="$1"; shift
21     cmd="$1"; shift
22     echo "EXECUTE($host):" "$cmd" "$@" 1>&2
23     ssh $SSH_ARGS -l root $host /scratch/bluesky.git/microbench/setup/$cmd "$@" $(get_params)
24 }
25
26 BLUESKY_CACHE_SIZE=$((8 * 1024 * 1024))
27 BENCH_FILESIZE=$((1024 * 1024))
28 BENCH_BLOCKSIZE=0
29 BENCH_FILECOUNT=$((62))
30 BENCH_WRITERATIO=0.5
31 BENCH_THREADS=4
32 BENCH_DURATION=120
33 BENCH_INTERVALS=10
34 BENCH_DIRSIZE=128
35 NFS_BLOCKSIZE=1048576
36
37 sizes="128 512 1024 2048 8192"
38 ops_list="2000 1000 500 200 100 50 20 10"
39
40 run_one() {
41     PREFIX=$1
42
43     $HOME/bin/s3-cleanup.py mvrable-bluesky
44     $HOME/bin/s3-cleanup.py mvrable-bluesky-west
45     run_cmd $PROXY cleanup-proxy
46     run_cmd $PROXY run-proxy >$PREFIX.proxy 2>&1 &
47     proxy_pid=$!
48     sleep 10
49     run_cmd $BENCHER prepare-benchmark
50
51     for BENCH_OPS in $ops_list; do
52         sleep 10
53         echo "SETTINGS:" $(get_params)
54         get_params >$PREFIX-$BENCH_OPS.settings
55         run_cmd $BENCHER run-benchmark | tee $PREFIX-$BENCH_OPS.results
56     done
57
58     run_cmd $PROXY stop-proxy
59     echo "Waiting for proxy to stop..."
60     wait $proxy_pid
61 }
62
63 #for size in 128 256 512 768 1024 1536 2048; do
64 #    for filesize in 4 32 256 2048; do
65 run_experiments() {
66 for size in $sizes; do
67     BENCH_FILECOUNT=$(($size * 1024 / ($BENCH_FILESIZE / 1024)))
68
69     BENCH_BLOCKSIZE=32768
70     run_one $BLUESKY_TARGET-$BENCH_WRITERATIO-${size}M-32k
71
72     BENCH_BLOCKSIZE=0
73     run_one $BLUESKY_TARGET-$BENCH_WRITERATIO-${size}M-1024k
74 done
75 }
76
77 BLUESKY_TARGET=s3:mvrable-bluesky-west
78 BENCH_THREADS=4
79
80 for BENCH_WRITERATIO in 0.0 1.0 0.5; do
81     run_experiments
82 done