Redis configuration file in a detailed

Source: Internet
Author: User

#是否以后台进程运行, the default is no
Daemonize Yes
#如以后台进程运行, you need to specify a PID, which defaults to/var/run/redis.pid
Pidfile D:/redis/var/redis.pid
#监听端口, default is 6379
Port 6379
#绑定主机IP, the default value is 127.0.0.1 (note)
# bind 127.0.0.1
#超时时间, default is 300 (seconds) (0 to disable)
Timeout 300
#日志记录等级, there are 4 selectable values, Debug,verbose (default), notice,warning
LogLevel verbose
#日志记录方式, the default value is stdout
LogFile stdout
#可用数据库数, the default value is 16 and the default database is 0
Databases 16


################################ snapshotting #################################
#
# Save the DB on disk:
#指出在多长时间内 How many updates you have, synchronize the data to the data file. This can be a combination of multiple conditions, such as the default configuration file settings, set three conditions.
At least 1 keys in #900秒 (15 minutes) are changed
Save 900 1
At least 10 keys in #300秒 (5 minutes) are changed
Save 300 10
#60秒内至少有10000个key被改变
Save 60 10000
#存储至本地数据库时是否压缩数据, the default is Yes
Rdbcompression Yes
#本地数据库文件名, the default value is Dump.rdb
Dbfilename Dump.rdb
#本地数据库存放路径, the default value is./
Dir d:/redis/var
# #当snapshot时出现错误无法继续时, whether to block client "change operation", "error" may be due to disk full/disk failure/os level exception, etc.
Stop-writes-on-bgsave-error Yes


################################# REPLICATION #################################


#当本机为从服务时, set the IP and port of the primary service (note)
# slaveof <masterip> <masterport>
#当本机为从服务时, set the connection password for the primary service (note)
# Masterauth <master-password>


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


# Connection Password (note)
Requirepass 123


################################### LIMITS ####################################


# Maximum number of client connections, default No Limit (note) ' 0 ' means no limits.
# maxclients 128
# Set the maximum memory, when the maximum memory setting is reached, Redis will first attempt to clear the expired or expiring key, and when this method is processed, the maximum memory setting is reached and no further write operations can be made. Comments
# maxmemory <bytes>


############################## APPEND only MODE ###############################


# whether logging after each update operation, if not turned on, may result in loss of data over a period of time when power is lost. Because the Redis itself synchronizes data files in sync with the save conditions above, some data will only exist in memory for a period of time. Default value is no
AppendOnly Yes


# Update log file name, default value is appendonly.aof (note)
Appendfilename d:/redis/var/appendonly.aof
# If unsure, use "everysec".
# to update the log conditions, there are 3 optional values. No indicates that the data cache of the operating system is synchronized to disk, always means that the data is written to disk manually after each update operation, and EVERYSEC is synchronized once per second (the default value).
Appendfsync always
# Appendfsync Everysec
# Appendfsync No


################################ VIRTUAL MEMORY ###############################


# Whether to use virtual memory, the default value is no


#vm-enabled No
# vm-enabled Yes
# Virtual memory file path, default value is/tmp/redis.swap, cannot be shared by multiple Redis instances
#vm-swap-file D:/redis/redis.swap


# store all data greater than vm-max-memory in virtual memory, regardless of the vm-max-memory settings, all index data is memory stored (REDIS index data is keys), that is, when the vm-max-memory is set to 0, In fact, all value is present on disk. The default value is 0.
#vm-max-memory 0
#vm-page-size 32
#vm-pages 134217728


# You can set the number of threads to access the swap file, set the best not to exceed the machine's number of cores, if set to 0, then all of the swap file operations are serial. This can result in a long delay, but with good assurance of data integrity.
#vm-max-threads 0


############################### Advanced CONFIG ###############################


#glueoutputbuf Yes


#hash-max-zipmap-entries 64
#hash-max-zipmap-value 512
#activerehashing Yes


################################## includes ###################################


# Include One or more other config files here. This is useful if you
# has a standard template which goes to all Redis servers but also need
# to customize a few per-server settings. Include files can include
# Other files, so use this wisely.
#
# include/path/to/local.conf
# include/path/to/other.conf

Redis configuration file in a detailed

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.