Skip to content

Commit

Permalink
tests/redis: optimize redis
Browse files Browse the repository at this point in the history
change nr_task to nr_processes
bind the CPUs by nr_node

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 Jan 10, 2019
1 parent 9685ef4 commit 15d8fc9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions daemon/redis-server
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/sh
# - nr_task
# - nr_processes
# - cpu_node_bind
. $LKP_SRC/lib/reproduce-log.sh
bg_pids=""
redis_server=$BENCHMARK_ROOT/redis/bin/redis-server
# start redis server
for i in $(seq 1 "${nr_task}")
for i in $(seq 1 "${nr_processes}")
do
port=$((6379+$i))
if [ -n "$cpu_node_bind" ]; then
if [ "$cpu_node_bind" = "even" ]; then
bind=$(($i%2))
bind=$(($i%nr_node))
else
bind=$cpu_node_bind
fi
Expand Down
4 changes: 2 additions & 2 deletions jobs/memtier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ cluster: cs-localhost

cpu_node_bind: even

nr_processes: 4

if role server:
redis-server:
nr_task: 4

if role client:
memtier:
Expand All @@ -32,4 +33,3 @@ if role client:
nr_threads: 1
n_client: 3
n_pipeline: 64
nr_processes: 4
2 changes: 1 addition & 1 deletion jobs/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cluster: cs-localhost

cpu_node_bind: even

nr_task: 4
nr_processes: 4

if role server:
redis-server:
Expand Down
6 changes: 3 additions & 3 deletions tests/redis
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# - requests
# - n_pipeline
# - key_len
# - nr_task
# - nr_processes
# - cpu_node_bind

## Redis is an open source (BSD licensed), in-memory data structure store,
Expand All @@ -21,13 +21,13 @@ export PATH=$BENCHMARK_ROOT/redis/bin:$PATH
redis_dir=$TMP/redis/
rm -rf $redis_dir
mkdir -p $redis_dir
for i in $(seq 1 "${nr_task}")
for i in $(seq 1 "${nr_processes}")
do
port=$((6379+$i))

if [ -n "$cpu_node_bind" ]; then
if [ "$cpu_node_bind" = "even" ]; then
bind=$(($i%2))
bind=$(($i%nr_node))
else
bind=$cpu_node_bind
fi
Expand Down

0 comments on commit 15d8fc9

Please sign in to comment.