Set up synthetic write benchmark.
[bluesky.git] / microbench / run-synwrite.sh
1 #!/bin/bash
2
3 BASEDIR=$(dirname $(which $0))
4 . $BASEDIR/run-common.sh
5
6 BLUESKY_TARGET=s3:mvrable-readbench-west
7 BLUESKY_EXTRA_OPTS="BLUESKY_OPT_NO_CRYPTO=1"
8
9 rates="1 2 4 8 16 32 48 100000"
10
11 run_synbench() {
12     basename=$(date +%Y%m%d)-$1
13     BLUESKY_RUN_NAME=$basename
14
15     run_cmd $PROXY cleanup-proxy
16     run_cmd $PROXY run-proxy >$BLUESKY_RUN_NAME.proxy 2>&1 &
17     proxy_pid=$!
18     sleep 10
19
20     for SYNWRITE_RATE in $rates; do
21         run_cmd $BENCHER run-synwrite
22         sleep 60
23     done
24
25     run_cmd $PROXY stop-proxy
26     echo "Waiting for proxy to stop..."
27     wait $proxy_pid
28 }
29
30 for BLUESKY_CACHE_SIZE in $((512 * 1024)); do
31     run_synbench "write-$(($BLUESKY_CACHE_SIZE / 1024))M"
32 done