Redis configuration file reference

Redis configuration file parsing Internet have, not repeat them here. Offers some interesting modifications of parameters, the parameters marked in red need to be cautious, otherwise prone to primary synchronization an infinite loop from the whole amount

The NETWORK 

the bind 127.0 . 0.1   The default is the bind 127.0 . 0.1 , comment out the 

protected -mode NO default protected- the MODE yes, changed NO 

Port 6379    proposed changes fall, avoid using the default port tcp

 -backlog 511 recommendations turn up to 2048, and at the same time turn up Linux kernel parameters / proc / sys / net / core / somaxconn to 2048

 

 

The GENERAL 

logfile ""   proposed changes log path

 

SNAPSHOTTING save

 900 1 
save 300 10 
save 60 10000    comment out the three lines triggered rdb persistence, persistence turn triggered easily save operation has been done under high concurrency
 
dbfilename dump.rdb modified according to the actual situation, proposed changes to dump + port .rdb 

the dir ./ modified according to the actual situation, and may change this logfile, the configuration file in the same directory as a parent / app / redis / {conf, data, log}

 

REPLICATION 

Replica -read- only proposed changes yes to no, when the primary node fails, the node can be used immediately. the repl

 -timeout 60     is recommended to set longer, to avoid large total amount of nodes replicate high concurrency can not be completed within 60 seconds, 

the repl -backlog-size 1MB recommended setting 100mb +, to avoid the total amount generated by copying copy rdb + transport rdb + loading RDB, the master node squeeze the buffer is not enough cause has been copied in full amount.

 

LAZY FREEING inert delete parameters, open the configuration items leads to avoid big key to delete expired service blocking 

lazyfree -lazy- eviction eviction policy inert delete yes recommended that you turn 
lazyfree -lazy- The expire yes expired inert delete key, the proposed set to open 
lazyfree -lazy-Server- del yes del inert delete operation, it is recommended to open 
Replica -lazy flush-flush yes delete inert recommended that you turn

 

The MODE ONLY APPEND 

appendOnly yes recommended that you turn from node 

appendFileName " appendonly.aof "   according to the actual port to modify the proposed changes as appendonly + port .aof 

appendfsync Always node from the proposed changes to everysec, lasting compromise strategy, persistence in every second to aof . 
Auto -aof-rewrite-PERCENTAGE 100 according to the practical situation, just to avoid the expansion of 100% during peak aof file, triggering automatic aofrewrite operation, blocking service

 

CONFIG the ADVANCED Client

 -output-buffer-limit Replica 0 0 0 recommend turning off the master-slave replication buffer limit, avoid high concurrency, slave synchronization can not complete the full amount during the hard and soft limits, resulting in an infinite loop master-slave synchronization

 

Defragmentation the ACTIVE 

activedefrag NO advised to turn off, to avoid the debris recovered during the peak period. When fragmentation rate increases, business can be opened at off-peak hours.

 

Guess you like

Origin www.cnblogs.com/chou1214/p/12417037.html