-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.sh
103 lines (84 loc) · 5.54 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
DIR=$(PWD)
concurrency="5"
scale_list="1 2 4 8 16 32 64 128 256 512 1024"
workload_list="10 20 40 80"
container_nginx=$(docker run --rm -d -p 81:80/tcp benchmark:nginx)
container_hybrid=$(docker run --rm -d -p 82:80/tcp benchmark:hybrid)
container_ppm=$(docker run --rm -d -p 83:80/tcp benchmark:ppm)
for workload in $workload_list; do
mkdir -p $DIR/result/workload/nginx/$workload
cd $DIR/result/workload/nginx/$workload
echo "Start nginx $workload/$concurrency"
ab -q -k -n $workload -c $concurrency -g basic.txt http://localhost:81/basic > basic_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g hash_snefru.txt http://localhost:81/hash-snefru > hash_snefru_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g hash_ghost.txt http://localhost:81/hash-ghost > hash_ghost_result.txt 2>&1
# ab -q -k -n $workload -c $concurrency -g sleep.txt http://localhost:81/sleep > sleep_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g stream.txt http://localhost:81/stream > stream_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g random.txt http://localhost:81/random > random_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g big_stream.txt http://localhost:81/big-stream > big_stream_result.txt 2>&1
done
for workload in $workload_list; do
mkdir -p $DIR/result/workload/hybrid/$workload
cd $DIR/result/workload/hybrid/$workload
echo "Start hybrid $workload/$concurrency"
ab -q -k -n $workload -c $concurrency -g basic.txt http://localhost:82/basic > basic_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g hash_snefru.txt http://localhost:82/hash-snefru > hash_snefru_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g hash_ghost.txt http://localhost:82/hash-ghost > hash_ghost_result.txt 2>&1
# ab -q -k -n $workload -c $concurrency -g sleep.txt http://localhost:82/sleep > sleep_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g stream.txt http://localhost:82/stream > stream_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g random.txt http://localhost:82/random > random_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g big_stream.txt http://localhost:82/big-stream > big_stream_result.txt 2>&1
done
for workload in $workload_list; do
mkdir -p $DIR/result/workload/ppm/$workload
cd $DIR/result/workload/ppm/$workload
echo "Start ppm $workload/$concurrency"
ab -q -k -n $workload -c $concurrency -g basic.txt http://localhost:83/basic > basic_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g hash_snefru.txt http://localhost:83/hash-snefru > hash_snefru_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g hash_ghost.txt http://localhost:83/hash-ghost > hash_ghost_result.txt 2>&1
# ab -q -k -n $workload -c $concurrency -g sleep.txt http://localhost:83/sleep > sleep_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g stream.txt http://localhost:83/stream > stream_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g random.txt http://localhost:83/random > random_result.txt 2>&1
ab -q -k -n $workload -c $concurrency -g big_stream.txt http://localhost:83/big-stream > big_stream_result.txt 2>&1
done
for workload in $scale_list; do
current_concurrency=$concurrency
if [[ $workload -lt $concurrency ]]
then
current_concurrency=$workload
fi
echo "Start scale $workload/$current_concurrency"
mkdir -p $DIR/result/scale/nginx/$workload
cd $DIR/result/scale/nginx/$workload
ab -q -k -n $workload -c $current_concurrency -g basic.txt http://localhost:81/basic > basic_result.txt 2>&1
ab -q -k -n $workload -c $current_concurrency -g hash_snefru.txt http://localhost:81/hash-snefru > hash_snefru_result.txt 2>&1
mkdir -p $DIR/result/scale/hybrid/$workload
cd $DIR/result/scale/hybrid/$workload
ab -q -k -n $workload -c $current_concurrency -g basic.txt http://localhost:82/basic > basic_result.txt 2>&1
ab -q -k -n $workload -c $current_concurrency -g hash_snefru.txt http://localhost:82/hash-snefru > hash_snefru_result.txt 2>&1
mkdir -p $DIR/result/scale/ppm/$workload
cd $DIR/result/scale/ppm/$workload
ab -q -k -n $workload -c $current_concurrency -g basic.txt http://localhost:83/basic > basic_result.txt 2>&1
ab -q -k -n $workload -c $current_concurrency -g hash_snefru.txt http://localhost:83/hash-snefru > hash_snefru_result.txt 2>&1
done
for workload in $scale_list; do
echo "Start concurrency $workload/$workload"
mkdir -p $DIR/result/concurrency/nginx/$workload
cd $DIR/result/concurrency/nginx/$workload
ab -q -k -n $workload -c $workload -g basic.txt http://localhost:81/basic > basic_result.txt 2>&1
ab -q -k -n $workload -c $workload -g hash_snefru.txt http://localhost:81/hash-snefru > hash_snefru_result.txt 2>&1
mkdir -p $DIR/result/concurrency/hybrid/$workload
cd $DIR/result/concurrency/hybrid/$workload
ab -q -k -n $workload -c $workload -g basic.txt http://localhost:82/basic > basic_result.txt 2>&1
ab -q -k -n $workload -c $workload -g hash_snefru.txt http://localhost:82/hash-snefru > hash_snefru_result.txt 2>&1
mkdir -p $DIR/result/concurrency/ppm/$workload
cd $DIR/result/concurrency/ppm/$workload
ab -q -k -n $workload -c $workload -g basic.txt http://localhost:83/basic > basic_result.txt 2>&1
ab -q -k -n $workload -c $workload -g hash_snefru.txt http://localhost:83/hash-snefru > hash_snefru_result.txt 2>&1
done
echo 'shutdown nginx'
docker container stop $container_nginx
echo 'shutdown hibrid'
docker container stop $container_hybrid
echo 'shutdown ppm'
docker container stop $container_ppm