From: Michael Vrable Date: Mon, 14 Feb 2011 03:01:14 +0000 (-0800) Subject: Split benchmark file system setup and execution into separate steps. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=b2752c1bde79356615a2398195a16979b4570b20;p=bluesky.git Split benchmark file system setup and execution into separate steps. --- diff --git a/microbench/run2.sh b/microbench/run2.sh index 3bcc2e5..24f4348 100755 --- a/microbench/run2.sh +++ b/microbench/run2.sh @@ -1,6 +1,6 @@ #!/bin/bash -PARAMS="BLUESKY_CACHE_SIZE BLUESKY_TARGET BENCH_DURATION BENCH_FILESIZE BENCH_FILECOUNT BENCH_WRITERATIO BENCH_THREADS BENCH_OPS" +PARAMS="BLUESKY_CACHE_SIZE BLUESKY_TARGET BENCH_DURATION BENCH_FILESIZE BENCH_FILECOUNT BENCH_WRITERATIO BENCH_THREADS BENCH_OPS BENCH_INTERVALS" BENCHER=c09-44.sysnet.ucsd.edu PROXY=c09-45.sysnet.ucsd.edu @@ -16,7 +16,7 @@ get_params() { run_cmd() { host="$1"; shift cmd="$1"; shift - echo "EXECUTE($host):" "$cmd" "$@" + echo "EXECUTE($host):" "$cmd" "$@" 1>&2 ssh -l root $host /scratch/bluesky.git/microbench/setup/$cmd "$@" $(get_params) } @@ -35,6 +35,7 @@ for size in 512; do run_cmd $PROXY run-proxy >$PREFIX.proxy 2>&1 & proxy_pid=$! sleep 10 + run_cmd $BENCHER prepare-benchmark run_cmd $BENCHER run-benchmark | tee $PREFIX.results run_cmd $PROXY stop-proxy echo "Waiting for proxy to stop..." diff --git a/microbench/setup/prepare-benchmark b/microbench/setup/prepare-benchmark new file mode 100755 index 0000000..0102705 --- /dev/null +++ b/microbench/setup/prepare-benchmark @@ -0,0 +1,42 @@ +#!/bin/bash +# +# Prepare a file system for a benchmark run by creating any needed files or +# directories. + + +# Defaults +SERVER=c09-45.sysnet.ucsd.edu +MNTDIR=/mnt/bluesky + +BENCH_FILESIZE=$((1 << 12)) +BENCH_FILECOUNT=$((8)) +BENCH_WRITERATIO=1.0 +BENCH_THREADS=8 +BENCH_DURATION=120 +BENCH_OPS=100 +BENCH_INTERVALS=4 + +# Export any environment variables specified on the command line +for e in "$@"; do + echo "$e" 1>&2 + if echo "$e" | grep = >/dev/null; then + eval "$e" + export ${e%=*} + fi +done + +# Prepare to run the benchmark +mount -t nfs -o vers=3,tcp,rw,soft,intr $SERVER:/export $MNTDIR + +pushd $MNTDIR >/dev/null + +for t in $(seq 0 $(($BENCH_THREADS - 1))); do + mkdir t$t + for i in $(seq 0 $(($BENCH_FILECOUNT - 1))); do + dd if=/dev/zero of=t$t/$i bs=$BENCH_FILESIZE count=1 + done +done + +popd >/dev/null + +umount -f $MNTDIR diff --git a/microbench/setup/run-benchmark b/microbench/setup/run-benchmark index 2942f48..bf061a4 100755 --- a/microbench/setup/run-benchmark +++ b/microbench/setup/run-benchmark @@ -29,13 +29,6 @@ mount -t nfs -o vers=3,tcp,rw,soft,intr $SERVER:/export $MNTDIR pushd $MNTDIR >/dev/null -for t in $(seq 0 $(($BENCH_THREADS - 1))); do - mkdir t$t - for i in $(seq 0 $(($BENCH_FILECOUNT - 1))); do - dd if=/dev/zero of=t$t/$i bs=$BENCH_FILESIZE count=1 - done -done - /scratch/bluesky.git/microbench/mixedbench \ $BENCH_FILESIZE \ $BENCH_FILECOUNT \