-
Notifications
You must be signed in to change notification settings - Fork 493
/
bench-redis.sh
executable file
·43 lines (37 loc) · 1.11 KB
/
bench-redis.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
#!/bin/bash
set -e
pl=$1
if [ "$pl" == "" ]; then
pl="1"
fi
echo ""
echo "--- BENCH REDIS PIPELINE $pl START ---"
echo ""
cd $(dirname "${BASH_SOURCE[0]}")
function cleanup {
echo "--- BENCH REDIS PIPELINE $pl DONE ---"
kill -9 $(jobs -rp)
wait $(jobs -rp) 2>/dev/null
}
trap cleanup EXIT
mkdir -p bin
$(pkill -9 redis-server || printf "")
$(pkill -9 evio-redis-server || printf "")
function gobench {
echo "--- $1 ---"
if [ "$3" != "" ]; then
go build -o $2 $3
fi
GOMAXPROCS=1 $2 --port $4 &
sleep 1
echo "*** 50 connections, 1000000 commands, $pl commands pipeline"
redis-benchmark -p $4 -t ping_inline -q -c 50 -P $pl -n 1000000
# echo "*** 50 connections, 1000000 commands, 10 commands pipeline"
# redis-benchmark -p $4 -t ping_inline -q -c 50 -P 10 -n 1000000
# echo "*** 50 connections, 1000000 commands, 20 commands pipeline"
# redis-benchmark -p $4 -t ping_inline -q -c 50 -P 20 -n 1000000
echo "--- DONE ---"
echo ""
}
gobench "REAL REDIS" redis-server "" 6392
gobench "EVIO REDIS CLONE" bin/evio-redis-server ../examples/redis-server/main.go 6393