diff options
author | zhenwei pi <pizhenwei@bytedance.com> | 2020-05-02 20:05:39 +0800 |
---|---|---|
committer | zhenwei pi <pizhenwei@bytedance.com> | 2020-05-02 21:19:47 +0800 |
commit | 1a0deab2a548fa306171f03439e858c00836fe69 (patch) | |
tree | 776c4d73d8fa4f0e0dfa6f7c386327e9939186ea /redis.conf | |
parent | 365316aa59545d90de4e105cec57f22aa5b52ff9 (diff) | |
download | redis-1a0deab2a548fa306171f03439e858c00836fe69.tar.gz |
Support setcpuaffinity on linux/bsd
Currently, there are several types of threads/child processes of a
redis server. Sometimes we need deeply optimise the performance of
redis, so we would like to isolate threads/processes.
There were some discussion about cpu affinity cases in the issue:
https://github.com/antirez/redis/issues/2863
So implement cpu affinity setting by redis.conf in this patch, then
we can config server_cpulist/bio_cpulist/aof_rewrite_cpulist/
bgsave_cpulist by cpu list.
Examples of cpulist in redis.conf:
server_cpulist 0-7:2 means cpu affinity 0,2,4,6
bio_cpulist 1,3 means cpu affinity 1,3
aof_rewrite_cpulist 8-11 means cpu affinity 8,9,10,11
bgsave_cpulist 1,10-11 means cpu affinity 1,10,11
Test on linux/freebsd, both work fine.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Diffstat (limited to 'redis.conf')
-rw-r--r-- | redis.conf | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/redis.conf b/redis.conf index d96d26e1c..756073a27 100644 --- a/redis.conf +++ b/redis.conf @@ -1780,3 +1780,18 @@ rdb-save-incremental-fsync yes # Maximum number of set/hash/zset/list fields that will be processed from # the main dictionary scan # active-defrag-max-scan-fields 1000 + +# Redis server/IO threads, bio threads, aof rewrite child process, and bgsave +# child process cpu affinity list config. syntax of cpu list looks like taskset +# command. serveral examples: +# set redis server/io threads to cpu affinity 0,2,4,6 +# server_cpulist 0-7:2 +# +# set bio threads to cpu affinity 1,3 +# bio_cpulist 1,3 +# +# set aof rewrite child process to cpu affinity 8,9,10,11 +# aof_rewrite_cpulist 8-11 +# +# set bgsave child process to cpu affinity 1,10,11 +# bgsave_cpulist 1,10-11 |