Description of the parameters of the Redis configuration file

 

A recent project uses Redis for data caching. The most important thing when using Redis is to write configuration files, so we need to understand the meaning of its various configuration parameters. After sorting it out today, I found that some parameters are not very clear. I have posted it here, please help me .

 

daemonize <yes|no>: Whether to run as a background daemon # yes|no (default:no)

pidfile <*.pid>: pid file location, only works when daemonize is yes # *.pid path (ex:/var/run/redis.pid)

port <port>: port number to listen on # (default:6379)

timeout <seconds>: Request timeout time (unit: seconds)

loglevel <debug|verbose|notice|warning>:log信息级别 # debug|verbose|notice|warning

logfile <filename>: log file location # (default: stdout)

databases <number>: Number of open databases

save <seconds> <changes>: The frequency of saving snapshots. When a certain number of write operations are performed within a certain period of time, snapshots are automatically saved. Multiple conditions can be set.

slaveof <master-ip> <master-port>: When this machine is a slave service, set the IP and port of the master service

masterauth <master-password>: When this machine is a slave service, set the connection password of the master service

requirepass: connection password

maxclients <number>: The maximum number of client connections, 0 is unlimited # (default:0)

maxmemory <bytes>: Set the maximum memory. After reaching the maximum memory setting, Redis will first try to clear the keys that have expired or are about to expire. After this method is processed, if the maximum memory setting is reached, no more write operations will be performed.

rdbcompression <yes|no>: Whether to use compression # yes|no (default:yes)

dbfilename <*.rdb>: data snapshot file name (just the file name, not including the directory) # *.rdb

dir <directory>: save directory of data snapshots (this is the directory)

appendonly <yes|no>: Whether to enable appendonlylog, if enabled, a log will be recorded for each write operation, which will improve data risk resistance, but affect efficiency. # yes|no

appendfilename <*.aof> Update log file name# (default:appendonly.aof)

appendfsync <always|everysec|no>: how appendonlylog is synchronized to disk (always: force to call fsync every write; everysec: enable fsync once per second; no: do not call fsync to wait for the system to synchronize itself)

vm-enabled <yes|no>: Whether to enable virtual memory # yes|no (default:no)

vm-swap-file <*.swap>: swap partition file (used when virtual memory is enabled) # *.swap path (ex:/tmp/redis.swap)

vm-max-memory <number>: Store all data larger than vm-max-memory in virtual memory, no matter how small vm-max-memory is set, all index data are stored in memory (Redis index data is keys) , that is, when vm-max-memory is set to 0, all values ​​actually exist on disk. # (default:0)

vm-page-size <bytes>: swap file page size (set according to the size of the stored value, in bytes) # (default:32)

vm-pages <number>: The number of memory pages in the swap partition file# (default:134217728)

vm-max-threads <number>: The maximum number of threads to operate on the swap file (preferably the number of CPUs) # (default:4)

glueoutputbuf <yes|no>: # yes|no (default:yes)

hash-max-zipmap-entries <number>: # (default:64)

hash-max-zipmap-value <number>: # (default:512)

activerehashing <yes|no>: # yes|no (default:yes)

include <*.conf>: refer to another configuration file # *.conf path (ex:/path/to/other.conf)

 

The following parameters without comments are configurations that I don't quite understand. Please enlighten me.

Some of the comments may also be misunderstood, please correct me.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327044505&siteId=291194637
Recommended