-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbenchmark.sh
74 lines (68 loc) · 1.82 KB
/
benchmark.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
set -e
dataset=twitter
latency=true
throughput=false
QUERY_DIR=/mnt/mnt/twitter2010-40attr16each-queries
OUTPUT_DIR=/mnt/mnt/output
mkdir -p $OUTPUT_DIR
# List of all possible queries you can benchmark against
# Comment any out if you don't want to benchmark them
tests=(
# Primitive queries
Neighbor
NeighborNode
EdgeAttr
NeighborAtype
# Node
NodeNode
MixPrimitive
# TAO queries
AssocRange
ObjGet
AssocGet
AssocCount
AssocTimeRange
MixTao
)
#JVM_HEAP=6900
#echo "Setting -Xmx to ${JVM_HEAP}m"
export MAVEN_OPTS="-verbose:gc -server -Xmx50000M"
warmup=100000
measure=200000
warmup_time=30
measure_time=60
cooldown_time=15
numClients=( 1 8 64 128 )
if [ "$latency" = true ]; then
for test in "${tests[@]}"; do
sudo sh -c 'service cassandra stop'
sleep 5
sync && sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
sudo sh -c 'service cassandra start'
sleep 15
nodetool invalidaterowcache
nodetool invalidatekeycache
nodetool invalidatecountercache
sleep 2
mvn exec:java -Dexec.mainClass="edu.berkeley.cs.benchmark.Benchmark" \
-Dexec.args="${test} latency ${dataset} ${QUERY_DIR} ${OUTPUT_DIR} ${warmup} ${measure}"
done
fi
if [[ "$throughput" = true ]]; then
for test in "${tests[@]}"; do
for numClient in "${numClients[@]}"; do
sudo sh -c 'service cassandra stop'
sleep 5
sync && sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
sudo sh -c 'service cassandra start'
sleep 15
nodetool invalidaterowcache
nodetool invalidatekeycache
nodetool invalidatecountercache
sleep 2
mvn exec:java -Dexec.mainClass="edu.berkeley.cs.benchmark.Benchmark" \
-Dexec.args="${test} throughput ${dataset} ${QUERY_DIR} ${OUTPUT_DIR} ${numClient} ${warmup_time} ${measure_time} ${cooldown_time}"
done
done
fi