Redis 2.8.13 configuration file description

Source: Internet
Author: User
During deployment, we mentioned the redis. conf file, which is the most important configuration file for redis. The parameters are described as follows:

Attribute

Description

Daemonize

If the value is "yes", the service is started in the form of a background daemon. If the value is "no", the opposite is true.

Pidfile

Specify the file path for storing the redis process number

Port

Specifies the port of the current redis service. The default value is 6379.

TCP-backlog

This parameter determines the length of the completed Queue (after three handshakes) in the TCP connection, of course, this value must not be greater than the/proc/sys/NET/CORE/somaxconn value defined by the Linux system. The default value is 511, while the default value of Linux is 128. When the system concurrency is large and the client speed is slow, you can set these two parameters.

Timeout

The connection timeout between the client and the redis server. The default value is 0, indicating that the connection never times out.

TCP-keepalive

If the value is not 0 and the unit is second, so_keepalive is periodically used to check whether the client is still healthy to avoid server congestion. The recommended value is 60 s.

Loglevel

Redis supports four levels: Debug, verbose, notice, and warning.

Debug: records a lot of information for development and testing;

Varbose: useful information, not as many as debug records;

Notice: Common verbose, usually used in the production environment;

Warning: logs are recorded only for important or serious information;

The default value is notice.

Logfile

Log storage path

Databases

Number of available databases. The default value is 16. The default value is 0. The database range is between 0 and (Database-1). In my opinion, the concept of DB is similar to that of namespace.

Save

When you save the snapshot information of a database to a disk, the corresponding values are two. For example, save 300 10 indicates that an event is triggered when at least 10 keys are changed within 300 seconds.

Stop-writes-on-bgsave-Error

Whether to continue to provide the write service after a persistence error occurs

Rdbcompression

Whether to compress the data to RDB. "Yes" indicates compression, and "no" indicates compression.

Rdbchecksum

Whether crc64 verification is supported during reading and writing. It is enabled by default.

Dbfilename

Image File Name

Dir

The current working directory, configuration files, and image files are all under this directory.

Masterauth

Set the password for accessing the master server

Slave-serve-stale-Data

When the slave server and the master server lose connection, or when the data is being copied and transmitted, if this parameter value is set to "yes", the slave server can continue to accept client requests. Otherwise, the following information will be returned to the requesting client: "sync with Master in SS"

Slave-read-only

Whether to allow slave server nodes to only provide read services

Repl-Disable-TCP-nodelay

Specifies whether to disable socket no_delay when synchronizing data to slave. If "yes" is configured, no_delay is disabled. The TCP protocol stack combines packets for unified sending, which can reduce the number of packets between the master and slave nodes and save bandwidth, but it will increase the time for data synchronization to slave. If it is set to "no", it indicates that no_delay is enabled, the TCP protocol stack will not delay the packet sending time, so that the latency of Data Synchronization will be reduced, but greater bandwidth is required. In general, it should be set to no to reduce synchronization latency, but can be set to yes when the network load between the master and slave nodes is already high.

Slave-priority

Specify the slave priority. In a deployment environment where more than one slave exists, when the master node goes down, redis Sentinel will upgrade the slave with the smallest priority value to the master node. Note that if this configuration item is set to 0, the corresponding slave will never be automatically upgraded to master.

Appendonly

After the append only mode is enabled, redis will append each write operation request received to appendonly. in the aof file, when redis is restarted, the previous state will be restored from the file. However, this will cause the appendonly. aof file to be too large, so redis also supports the bgrewriteaof command to reorganize appendonly. Aof. It is disabled by default.

Appendfilename

The default value is appendonly. Aof.

Appendfsync

Set the aof synchronization frequency. There are three options: Always, everysec, and No. The default value is everysec, indicating that the synchronization is performed once per second.

No-appendfsync-on-Rewrite

Specifies whether to call fsync during the rewrite of the aof file in the background. The default value is no, indicating that fsync is to be called (whether or not a sub-process is flushing the disk in the background ). Redis will have a large number of disk Io during RDB file writing or AFO file rewriting in the background. In some Linux systems, calling fsync may be blocked.

Auto-Aof-rewrite-Percentage

Specify the condition for redis to override the aof file. The default value is 100, indicating that when the current aof file size exceeds 100% of the size of the last AFO file, this will trigger the background rewrite. If it is set to 0, automatic rewrite is disabled.

Auto-Aof-rewrite-Min-size

Specifies the size of the aof file that triggers rewrite. If the aof file is smaller than this value, automatic rewrite is not triggered even if the Incremental Ratio of the current file reaches the configured value of auto-Aof-rewrite-percentage. That is, when both configuration items are met, the rewrite will be triggered.

Lua-time-limit

The maximum execution time of a Lua script, in milliseconds. If it is 0 or negative, it indicates unlimited execution time. The default value is 5000.

Policy-keyspace-Events

See reference 3 for button notification events.

Aof-rewrite-incremental-fsync

Whether to adopt the incremental file synchronization policy during aof rewrite. The default value is "yes ". During the rewrite process, a file is synchronized every 32 MB of data, which can reduce the number of disk operations for writing aof large files

 

 

Requirepass 123456 requires password verification 123456

 

Redis 2.8.13 configuration file description

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.