Skip to content

Commit

Permalink
tests: add numactl support in redis
Browse files Browse the repository at this point in the history
Signed-off-by: Zhengjun Xing <[email protected]>
Acked-by: "Huang, Ying" <[email protected]>
Signed-off-by: Philip Li <[email protected]>
  • Loading branch information
ZhengjunXing authored and rli9 committed Dec 29, 2018
1 parent e387d82 commit 67eb4bd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
13 changes: 10 additions & 3 deletions daemon/redis-server
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/bin/sh
# - nr_task
# - enable_numa_bind
. $LKP_SRC/lib/reproduce-log.sh

. $LKP_SRC/lib/common.sh
bg_pids=""
redis_server=$BENCHMARK_ROOT/redis/bin/redis-server
# start redis server
for i in $(seq 1 "${nr_task}")
do
port=$((6379+$i))
log_eval "$redis_server --port $port &"
if parse_bool -q "$enable_numa_bind"; then
bind=$(($i%2))
numa_bind="numactl --cpunodebind=$bind --"
fi
log_eval "$numa_bind $redis_server --port $port &"
bg_pids="$bg_pids $!"
done

cat > $TMP_RESULT_ROOT/post-run.redis <<EOF
/bin/kill -9 $(ps -ef | grep $redis_server | grep -v grep | awk '{print $2}')
/bin/kill -9 $bg_pids
EOF
13 changes: 9 additions & 4 deletions jobs/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ category: benchmark

nr_threads: 100%

numactl:
all: 1

sysctl:
sc_overcommit_memory: 1
sc_somaxconn: 65535
Expand All @@ -14,16 +17,18 @@ transparent_hugepage:

cluster: cs-localhost

enable_numa_bind: 1

nr_task: 4

if role server:
redis-server:
nr_task: 5

if role client:
redis:
test: set,get
data_size: 1024
n_client: 5
requests: 21000000
requests: 17000000
n_pipeline: 3
key_len: 21000000
nr_task: 5
key_len: 17000000
9 changes: 7 additions & 2 deletions tests/redis
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# - n_pipeline
# - key_len
# - nr_task
# - enable_numa_bind

## Redis is an open source (BSD licensed), in-memory data structure store,
## used as a database, cache and message broker. It supports data structures
Expand All @@ -16,11 +17,15 @@
## to the Apache's ab utility)

. $LKP_SRC/lib/reproduce-log.sh

. $LKP_SRC/lib/common.sh
export PATH=$BENCHMARK_ROOT/redis/bin:$PATH
for i in $(seq 1 "${nr_task}")
do
port=$((6379+$i))
log_test redis-benchmark -t $test -d $data_size -c $n_client -n $requests -P $n_pipeline -r $key_len -p $port&
if parse_bool -q "$enable_numa_bind"; then
bind=$(($i%2))
numa_bind="numactl --cpunodebind=$bind --"
fi
log_test $numa_bind redis-benchmark -t $test -d $data_size -c $n_client -n $requests -P $n_pipeline -r $key_len -p $port&
done
wait

0 comments on commit 67eb4bd

Please sign in to comment.