Merge git+ssh://idril.vpn.vrable.net/home/mvrable/local/bluesky
[bluesky.git] / microbench / run2.sh
1 #!/bin/bash
2
3 PARAMS="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 BENCHER=c09-44.sysnet.ucsd.edu
6 PROXY=c09-45.sysnet.ucsd.edu
7
8 SSH_ARGS=""
9
10 get_params() {
11     for p in $PARAMS; do
12         if [ -n "${!p}" ]; then
13             echo "$p=${!p}"
14         fi
15     done
16 }
17
18 run_cmd() {
19     host="$1"; shift
20     cmd="$1"; shift
21     echo "EXECUTE($host):" "$cmd" "$@" 1>&2
22     ssh $SSH_ARGS -l root $host /scratch/bluesky.git/microbench/setup/$cmd "$@" $(get_params)
23 }
24
25 BLUESKY_CACHE_SIZE=$((512 * 1024))
26 BENCH_FILESIZE=$((1024 << 10))
27 BENCH_BLOCKSIZE=0
28 BENCH_FILECOUNT=$((62))
29 BENCH_WRITERATIO=0.5
30 BENCH_THREADS=4
31 BENCH_DURATION=120
32 BENCH_INTERVALS=10
33 BENCH_DIRSIZE=128
34 NFS_BLOCKSIZE=1048576
35
36 sizes="128 512 1024 2048"
37 ops_list="2000 1000 500 200 100 50 20 10"
38
39 run_one() {
40     PREFIX=$1
41
42     $HOME/bin/s3-cleanup.py
43     SSH_ARGS="-t"
44     run_cmd $PROXY cleanup-proxy
45     SSH_ARGS=""
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     for filesize in 4 32; do
68         BENCH_BLOCKSIZE=$(($filesize * 1024))
69         BENCH_FILECOUNT=$(($size * 1024 / ($BENCH_FILESIZE / 1024)))
70         PREFIX=$BLUESKY_TARGET-$BENCH_WRITERATIO-${size}M-${filesize}k
71
72         run_one $PREFIX
73     done
74 done
75 }
76
77 BLUESKY_TARGET=s3
78 BENCH_FILESIZE=1048576
79 BENCH_FILECOUNT=1024
80 BENCH_WRITERATIO=0.0
81 BENCH_THREADS=4
82 run_one repeat-1024M-1024k
83
84 #for BENCH_WRITERATIO in 0.0 1.0 0.5; do
85 #    BLUESKY_TARGET=s3
86 #    sizes="128 512 1024 2048"
87 #    run_experiments
88 #
89 #    BLUESKY_TARGET=native
90 #    sizes=128
91 #    run_experiments
92 #done