Redis配置

2018.02.01-Redis配置

@(技术-Linux)[Linux, Redis, redis]

Redis的redis.conf配置

################################## NETWORK #####################################

bind 127.0.0.1

protected-mode yes

port 6379

tcp-backlog 511

timeout 0

tcp-keepalive 300

daemonize yes

supervised no

pidfile /usr/local/redis/redis.pid

loglevel notice

logfile /usr/local/redis/log/redis.log

databases 16

always-show-logo yes

################################ SNAPSHOTTING  ################################

save 900 1
save 300 10
save 60 10000

stop-writes-on-bgsave-error yes

rdbcompression yes

rdbchecksum yes

dbfilename redis.rdb

dir /usr/local/redis/data

################################# REPLICATION #################################
slave-serve-stale-data yes

slave-read-only yes

repl-diskless-sync no

repl-diskless-sync-delay 5

# repl-ping-slave-period 10

# repl-timeout 60

repl-disable-tcp-nodelay no

# repl-backlog-size 1mb

# repl-backlog-ttl 3600

slave-priority 100

# min-slaves-to-write 3
# min-slaves-max-lag 10

# min-slaves-max-lag is set to 10.

# slave-announce-ip 5.5.5.5
# slave-announce-port 1234

################################## SECURITY ###################################

# Example:
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52

# rename-command CONFIG ""

################################### CLIENTS ####################################

# maxclients 10000

############################## MEMORY MANAGEMENT ################################

# maxmemory <bytes>

# maxmemory-policy noeviction

# maxmemory-samples 5

############################# LAZY FREEING ####################################

lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
slave-lazy-flush no

############################## APPEND ONLY MODE ###############################

appendonly no

appendfilename "appendonly.aof"

# appendfsync always
appendfsync everysec
# appendfsync no

no-appendfsync-on-rewrite no

auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb

aof-load-truncated yes

aof-use-rdb-preamble no

################################ LUA SCRIPTING  ###############################

lua-time-limit 5000

################################ REDIS CLUSTER  ###############################

# cluster-enabled yes

# cluster-config-file nodes-6379.conf

# cluster-node-timeout 15000

# cluster-slave-validity-factor 10

# cluster-migration-barrier 1

# cluster-require-full-coverage yes

########################## CLUSTER DOCKER/NAT support  ########################

# cluster-announce-ip 10.1.1.5
# cluster-announce-port 6379
# cluster-announce-bus-port 6380

################################## SLOW LOG ###################################

slowlog-max-len 128

################################ LATENCY MONITOR ##############################

latency-monitor-threshold 0

############################# EVENT NOTIFICATION ##############################

# PUBLISH __keyspace@0__:foo del
# PUBLISH __keyevent@0__:del foo

notify-keyspace-events ""

############################### ADVANCED CONFIG ###############################
hash-max-ziplist-entries 512
hash-max-ziplist-value 64

list-max-ziplist-size -2

list-compress-depth 0

set-max-intset-entries 512

zset-max-ziplist-entries 128
zset-max-ziplist-value 64

hll-sparse-max-bytes 3000

activerehashing yes

client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60

# client-query-buffer-limit 1gb

# proto-max-bulk-len 512mb

hz 10

aof-rewrite-incremental-fsync yes

# lfu-log-factor 10
# lfu-decay-time 1

########################### ACTIVE DEFRAGMENTATION #######################

# activedefrag yes

# active-defrag-ignore-bytes 100mb

# active-defrag-threshold-lower 10

# active-defrag-threshold-upper 100

# active-defrag-cycle-min 25

# active-defrag-cycle-max 75
    原文作者:jbearmen
    原文地址: https://segmentfault.com/a/1190000013386397
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞