* Benchmark duration (seconds)
* Target operations per second (aggregate across all threads)
* Interval count (how many times to report results during the run)
+ * Directory size (number of files per numbered subdirectory)
*/
#include <errno.h>
#include <unistd.h>
#include <math.h>
-int opt_filesize, opt_filecount, opt_threads, opt_duration, opt_intervals;
+int opt_filesize, opt_filecount, opt_threads, opt_duration, opt_intervals, opt_dirsize;
double opt_writeratio, opt_ops;
struct thread_state {
start = now_hires();
- char filename[64];
- sprintf(filename, "t%d/%d", ts->thread_num, get_random(opt_filecount));
+ char filename[256];
+ int n = get_random(opt_filecount);
+ int n1 = n / opt_dirsize, n2 = n % opt_dirsize;
+ sprintf(filename, "t%d/%d/%d", ts->thread_num, n1, n2);
double r = get_random(1000000) / 1e6;
int main(int argc, char *argv[])
{
- if (argc != 8) {
+ if (argc != 9) {
fprintf(stderr, "Usage: TODO\n");
return 1;
}
opt_duration = atoi(argv[5]);
opt_ops = atof(argv[6]);
opt_intervals = atoi(argv[7]);
+ opt_dirsize = atoi(argv[7]);
srandom(time(NULL));
#!/bin/bash
-PARAMS="BLUESKY_CACHE_SIZE BLUESKY_TARGET BENCH_DURATION BENCH_FILESIZE BENCH_FILECOUNT BENCH_WRITERATIO BENCH_THREADS BENCH_OPS BENCH_INTERVALS"
+PARAMS="BLUESKY_CACHE_SIZE BLUESKY_TARGET BENCH_DURATION BENCH_FILESIZE BENCH_FILECOUNT BENCH_WRITERATIO BENCH_THREADS BENCH_OPS BENCH_INTERVALS BENCH_DIRSIZE"
BENCHER=c09-44.sysnet.ucsd.edu
PROXY=c09-45.sysnet.ucsd.edu
+SSH_ARGS=""
+
get_params() {
for p in $PARAMS; do
if [ -n "${!p}" ]; then
host="$1"; shift
cmd="$1"; shift
echo "EXECUTE($host):" "$cmd" "$@" 1>&2
- ssh -l root $host /scratch/bluesky.git/microbench/setup/$cmd "$@" $(get_params)
+ ssh $SSH_ARGS -l root $host /scratch/bluesky.git/microbench/setup/$cmd "$@" $(get_params)
}
-for size in 512; do
- BENCH_DURATION=20
- BENCH_WRITERATIO=0.0
- BLUESKY_TARGET=s3
- BLUESKY_CACHE_SIZE=$(($size * 1024))
-
- PREFIX=$BLUESKY_TARGET-$BENCH_WRITERATIO
-
- echo "SETTINGS:" $(get_params)
- get_params >$PREFIX.settings
-
- run_cmd $PROXY cleanup-proxy
- 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..."
- wait $proxy_pid
+BLUESKY_TARGET=s3
+BLUESKY_CACHE_SIZE=$((512 * 1024))
+BENCH_FILESIZE=$((1 << 20))
+BENCH_FILECOUNT=$((62))
+BENCH_WRITERATIO=0.0
+BENCH_THREADS=4
+BENCH_DURATION=120
+BENCH_INTERVALS=10
+BENCH_DIRSIZE=256
+
+#for size in 128 256 512 768 1024 1536 2048; do
+# for filesize in 4 32 256 2048; do
+for size in 128 256 512 768 1024 1536 2048; do
+ for filesize in 4 1024; do
+ BENCH_FILESIZE=$(($filesize * 1024))
+ BENCH_FILECOUNT=$(($size * 1024 / $filesize / $BENCH_THREADS))
+ PREFIX=$BLUESKY_TARGET-$BENCH_WRITERATIO-${size}M-${filesize}k
+
+ $HOME/bin/s3-cleanup.py
+ SSH_ARGS="-t"
+ run_cmd $PROXY cleanup-proxy
+ SSH_ARGS=""
+ run_cmd $PROXY run-proxy >$PREFIX.proxy 2>&1 &
+ proxy_pid=$!
+ sleep 10
+ run_cmd $BENCHER prepare-benchmark
+
+ #for BENCH_OPS in 2000 1500 1000 800 600 400 200 100 80 40 20 10; do
+ for BENCH_OPS in 2000 1000 500 200 100 50 20 10; do
+ sleep 10
+ echo "SETTINGS:" $(get_params)
+ get_params >$PREFIX-$BENCH_OPS.settings
+ run_cmd $BENCHER run-benchmark | tee $PREFIX-$BENCH_OPS.results
+ done
+
+ run_cmd $PROXY stop-proxy
+ echo "Waiting for proxy to stop..."
+ wait $proxy_pid
+ done
done
BENCH_DURATION=120
BENCH_OPS=100
BENCH_INTERVALS=4
+BENCH_DIRSIZE=256
# Export any environment variables specified on the command line
for e in "$@"; do
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
+ n1=$(($i / $BENCH_DIRSIZE))
+ n2=$(($i % $BENCH_DIRSIZE))
+ mkdir t$t/$n1
+ dd if=/dev/zero of=t$t/$n1/$n2 bs=$BENCH_FILESIZE count=1
done
done
+find -type f -exec sha1sum '{}' \;
+
popd >/dev/null
umount -f $MNTDIR