Add four-way latency comparison (NFS and CIFS)
[bluesky.git] / microbench / setup / run-benchmark
1 #!/bin/bash
2 #
3 # Start up the NFS server.
4
5
6 # Defaults
7 SERVER=vrable2.sysnet.ucsd.edu
8 MNTDIR=/mnt/bluesky
9
10 BENCH_FILESIZE=$((1 << 12))
11 BENCH_BLOCKSIZE=0
12 BENCH_FILECOUNT=$((8))
13 BENCH_WRITERATIO=1.0
14 BENCH_THREADS=8
15 BENCH_DURATION=120
16 BENCH_OPS=100
17 BENCH_INTERVALS=4
18 BENCH_DIRSIZE=256
19 BENCH_LOCKEDMEM=$((4096 - 256))
20 NFS_BLOCKSIZE=1048576
21
22 lock_memory() {
23     MEM=$1
24     while [ $MEM -gt 512 ]; do
25         /scratch/bluesky.git/microbench/lockmem 512 &
26         MEM=$(($MEM - 512))
27     done
28     if [ $MEM -gt 0 ]; then
29         /scratch/bluesky.git/microbench/lockmem $MEM &
30     fi
31 }
32
33 # Export any environment variables specified on the command line
34 for e in "$@"; do
35     echo "$e" 1>&2
36     if echo "$e" | grep = >/dev/null; then
37         eval "$e"
38         export ${e%=*}
39     fi
40 done
41
42 # Prepare to run the benchmark
43 lock_memory $BENCH_LOCKEDMEM
44
45 mount -t nfs -o vers=3,tcp,rw,soft,intr,rsize=$NFS_BLOCKSIZE,wsize=$NFS_BLOCKSIZE $SERVER:/export $MNTDIR
46
47 pushd $MNTDIR >/dev/null
48
49 /scratch/bluesky.git/microbench/mixedbench \
50     $BENCH_FILESIZE \
51     $BENCH_FILECOUNT \
52     $BENCH_WRITERATIO \
53     $BENCH_THREADS \
54     $BENCH_DURATION \
55     $BENCH_OPS \
56     $BENCH_INTERVALS \
57     $BENCH_DIRSIZE \
58     $BENCH_BLOCKSIZE
59
60 pkill -TERM lockmem
61
62 popd >/dev/null
63
64 umount -f $MNTDIR