-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbench.sh
executable file
·69 lines (55 loc) · 3.28 KB
/
bench.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
#!/bin/bash -e
leader=http://192.168.111.180:2379
# assume three servers
servers=( http://192.168.111.181:2379) # http://130.207.111.250:2379 )
keyarray=( 64 256 512) # number of bytes
for keysize in ${keyarray[@]}; do
# put one request at a time from one client to the leader
echo write, 1 client, $keysize key size, to leader
./boom -m PUT -n 10 -d value=`head -c $keysize < /dev/zero | tr '\0' '\141'` -c 1 -T application/x-www-form-urlencoded $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
# put multiple requests at a time from different clients to the leader
echo write, 64 client, $keysize key size, to leader
./boom -m PUT -n 640 -d value=`head -c $keysize < /dev/zero | tr '\0' '\141'` -c 64 -T application/x-www-form-urlencoded $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
# put multiple requests at a time from different clients to the leader
echo write, 256 client, $keysize key size, to leader
./boom -m PUT -n 2560 -d value=`head -c $keysize < /dev/zero | tr '\0' '\141'` -c 256 -T application/x-www-form-urlencoded $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
# put multiple requests at a time from different clients to all servers
echo write, 64 client, $keysize key size, to all servers
for i in ${servers[@]}; do
./boom -m PUT -n 210 -d value=`head -c $keysize < /dev/zero | tr '\0' '\141'` -c 21 -T application/x-www-form-urlencoded $i/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo &
done
# wait for all booms to start running
sleep 3
# wait for all booms to finish
for pid in $(pgrep 'boom'); do
while kill -0 "$pid" 2> /dev/null; do
sleep 3
done
done
echo write, 256 client, $keysize key size, to all servers
for i in ${servers[@]}; do
./boom -m PUT -n 850 -d value=`head -c $keysize < /dev/zero | tr '\0' '\141'` -c 85 -T application/x-www-form-urlencoded $i/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo &
done
sleep 3
for pid in $(pgrep 'boom'); do
while kill -0 "$pid" 2> /dev/null; do
sleep 3
done
done
echo read, 1 client, $keysize key size, to leader
./boom -n 100 -c 1 $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
echo read, 64 client, $keysize key size, to leader
./boom -n 6400 -c 64 $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
echo read, 256 client, $keysize key size, to leader
./boom -n 25600 -c 256 $leader/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
echo read, 64 client, $keysize key size, to all servers
# bench servers one by one, so it doesn't overload this benchmark machine
# It doesn't impact correctness because read request doesn't involve peer interaction.
for i in ${servers[@]}; do
./boom -n 21000 -c 21 $i/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
done
echo read, 256 client, $keysize key size, to all servers
for i in ${servers[@]}; do
./boom -n 85000 -c 85 $i/v2/keys/foo | grep -e "Requests/sec" -e "Latency" -e "90%" | tr "\n" "\t" | xargs echo
done
done