Tuning the Redis Configuration
Adjust Redis parameters to improve the Redis performance.
The parameters of each Redis instance can be adjusted by modifying the file in the default configuration path /etc/redis.conf.
Choose appropriate synchronization policies based on Table 1 and your actual requirements.
Parameter |
Default Value |
Recommended Value |
Description |
|---|---|---|---|
appendfsync |
everysec |
everysec |
Specifies the synchronization policy used when Redis writes data to drives. The options are as follows:
|
appendonly |
no |
no |
Indicates whether to enable the persistence function of Redis.
|
save |
save 900 1 save 300 10 save 60 10000 |
save "" |
Saves data to drives.
|
cluster-require-full-coverage |
yes |
yes |
Indicates whether to allocate all slots in the cluster to nodes (that is, full coverage).
|
maxmemory |
1024 |
1024 |
Specifies the maximum memory size occupied by Redis, in MB. |
maxmemory-policy |
noeviction |
noeviction |
Specifies the policy for clearing data when the maximum memory limit is reached. The options are as follows:
|
rdbchecksum |
yes |
yes |
Indicates whether to enable RDB checksum.
|
rdbcompression |
yes |
yes |
Indicates whether to compress data when Redis performs RDB persistence.
|
stop-writes-on-bgsave-error |
yes |
yes |
Specifies the action of handling an error that occurs when Redis performs a background persistence operation (bgsave).
|
activerehashing |
no |
no |
Indicates whether to reset the hash table.
|
activedefrag |
no |
no |
Indicates whether to enable defragmentation.
|