redis.conf 106 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321
  1. # Redis configuration file example.
  2. #
  3. # Note that in order to read the configuration file, Redis must be
  4. # started with the file path as first argument:
  5. #
  6. # ./redis-server /path/to/redis.conf
  7. # Note on units: when memory size is needed, it is possible to specify
  8. # it in the usual form of 1k 5GB 4M and so forth:
  9. #
  10. # 1k => 1000 bytes
  11. # 1kb => 1024 bytes
  12. # 1m => 1000000 bytes
  13. # 1mb => 1024*1024 bytes
  14. # 1g => 1000000000 bytes
  15. # 1gb => 1024*1024*1024 bytes
  16. #
  17. # units are case insensitive so 1GB 1Gb 1gB are all the same.
  18. ################################## INCLUDES ###################################
  19. # Include one or more other config files here. This is useful if you
  20. # have a standard template that goes to all Redis servers but also need
  21. # to customize a few per-server settings. Include files can include
  22. # other files, so use this wisely.
  23. #
  24. # Note that option "include" won't be rewritten by command "CONFIG REWRITE"
  25. # from admin or Redis Sentinel. Since Redis always uses the last processed
  26. # line as value of a configuration directive, you'd better put includes
  27. # at the beginning of this file to avoid overwriting config change at runtime.
  28. #
  29. # If instead you are interested in using includes to override configuration
  30. # options, it is better to use include as the last line.
  31. #
  32. # Included paths may contain wildcards. All files matching the wildcards will
  33. # be included in alphabetical order.
  34. # Note that if an include path contains a wildcards but no files match it when
  35. # the server is started, the include statement will be ignored and no error will
  36. # be emitted. It is safe, therefore, to include wildcard files from empty
  37. # directories.
  38. #
  39. # include /path/to/local.conf
  40. # include /path/to/other.conf
  41. # include /path/to/fragments/*.conf
  42. #
  43. ################################## MODULES #####################################
  44. # Load modules at startup. If the server is not able to load modules
  45. # it will abort. It is possible to use multiple loadmodule directives.
  46. #
  47. # loadmodule /path/to/my_module.so
  48. # loadmodule /path/to/other_module.so
  49. # loadmodule /path/to/args_module.so [arg [arg ...]]
  50. ################################## NETWORK #####################################
  51. # By default, if no "bind" configuration directive is specified, Redis listens
  52. # for connections from all available network interfaces on the host machine.
  53. # It is possible to listen to just one or multiple selected interfaces using
  54. # the "bind" configuration directive, followed by one or more IP addresses.
  55. # Each address can be prefixed by "-", which means that redis will not fail to
  56. # start if the address is not available. Being not available only refers to
  57. # addresses that does not correspond to any network interface. Addresses that
  58. # are already in use will always fail, and unsupported protocols will always BE
  59. # silently skipped.
  60. #
  61. # Examples:
  62. #
  63. # bind 192.168.1.100 10.0.0.1 # listens on two specific IPv4 addresses
  64. # bind 127.0.0.1 ::1 # listens on loopback IPv4 and IPv6
  65. # bind * -::* # like the default, all available interfaces
  66. #
  67. # ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
  68. # internet, binding to all the interfaces is dangerous and will expose the
  69. # instance to everybody on the internet. So by default we uncomment the
  70. # following bind directive, that will force Redis to listen only on the
  71. # IPv4 and IPv6 (if available) loopback interface addresses (this means Redis
  72. # will only be able to accept client connections from the same host that it is
  73. # running on).
  74. #
  75. # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
  76. # COMMENT OUT THE FOLLOWING LINE.
  77. #
  78. # You will also need to set a password unless you explicitly disable protected
  79. # mode.
  80. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. bind * -::*
  82. # By default, outgoing connections (from replica to master, from Sentinel to
  83. # instances, cluster bus, etc.) are not bound to a specific local address. In
  84. # most cases, this means the operating system will handle that based on routing
  85. # and the interface through which the connection goes out.
  86. #
  87. # Using bind-source-addr it is possible to configure a specific address to bind
  88. # to, which may also affect how the connection gets routed.
  89. #
  90. # Example:
  91. #
  92. # bind-source-addr 10.0.0.1
  93. # Protected mode is a layer of security protection, in order to avoid that
  94. # Redis instances left open on the internet are accessed and exploited.
  95. #
  96. # When protected mode is on and the default user has no password, the server
  97. # only accepts local connections from the IPv4 address (127.0.0.1), IPv6 address
  98. # (::1) or Unix domain sockets.
  99. #
  100. # By default protected mode is enabled. You should disable it only if
  101. # you are sure you want clients from other hosts to connect to Redis
  102. # even if no authentication is configured.
  103. protected-mode yes
  104. # Redis uses default hardened security configuration directives to reduce the
  105. # attack surface on innocent users. Therefore, several sensitive configuration
  106. # directives are immutable, and some potentially-dangerous commands are blocked.
  107. #
  108. # Configuration directives that control files that Redis writes to (e.g., 'dir'
  109. # and 'dbfilename') and that aren't usually modified during runtime
  110. # are protected by making them immutable.
  111. #
  112. # Commands that can increase the attack surface of Redis and that aren't usually
  113. # called by users are blocked by default.
  114. #
  115. # These can be exposed to either all connections or just local ones by setting
  116. # each of the configs listed below to either of these values:
  117. #
  118. # no - Block for any connection (remain immutable)
  119. # yes - Allow for any connection (no protection)
  120. # local - Allow only for local connections. Ones originating from the
  121. # IPv4 address (127.0.0.1), IPv6 address (::1) or Unix domain sockets.
  122. #
  123. # enable-protected-configs no
  124. # enable-debug-command no
  125. # enable-module-command no
  126. # Accept connections on the specified port, default is 6379 (IANA #815344).
  127. # If port 0 is specified Redis will not listen on a TCP socket.
  128. port 6379
  129. # TCP listen() backlog.
  130. #
  131. # In high requests-per-second environments you need a high backlog in order
  132. # to avoid slow clients connection issues. Note that the Linux kernel
  133. # will silently truncate it to the value of /proc/sys/net/core/somaxconn so
  134. # make sure to raise both the value of somaxconn and tcp_max_syn_backlog
  135. # in order to get the desired effect.
  136. tcp-backlog 511
  137. # Unix socket.
  138. #
  139. # Specify the path for the Unix socket that will be used to listen for
  140. # incoming connections. There is no default, so Redis will not listen
  141. # on a unix socket when not specified.
  142. #
  143. # unixsocket /run/redis.sock
  144. # unixsocketperm 700
  145. # Close the connection after a client is idle for N seconds (0 to disable)
  146. timeout 0
  147. # TCP keepalive.
  148. #
  149. # If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
  150. # of communication. This is useful for two reasons:
  151. #
  152. # 1) Detect dead peers.
  153. # 2) Force network equipment in the middle to consider the connection to be
  154. # alive.
  155. #
  156. # On Linux, the specified value (in seconds) is the period used to send ACKs.
  157. # Note that to close the connection the double of the time is needed.
  158. # On other kernels the period depends on the kernel configuration.
  159. #
  160. # A reasonable value for this option is 300 seconds, which is the new
  161. # Redis default starting with Redis 3.2.1.
  162. tcp-keepalive 300
  163. # Apply OS-specific mechanism to mark the listening socket with the specified
  164. # ID, to support advanced routing and filtering capabilities.
  165. #
  166. # On Linux, the ID represents a connection mark.
  167. # On FreeBSD, the ID represents a socket cookie ID.
  168. # On OpenBSD, the ID represents a route table ID.
  169. #
  170. # The default value is 0, which implies no marking is required.
  171. # socket-mark-id 0
  172. ################################# TLS/SSL #####################################
  173. # By default, TLS/SSL is disabled. To enable it, the "tls-port" configuration
  174. # directive can be used to define TLS-listening ports. To enable TLS on the
  175. # default port, use:
  176. #
  177. # port 0
  178. # tls-port 6379
  179. # Configure a X.509 certificate and private key to use for authenticating the
  180. # server to connected clients, masters or cluster peers. These files should be
  181. # PEM formatted.
  182. #
  183. # tls-cert-file redis.crt
  184. # tls-key-file redis.key
  185. #
  186. # If the key file is encrypted using a passphrase, it can be included here
  187. # as well.
  188. #
  189. # tls-key-file-pass secret
  190. # Normally Redis uses the same certificate for both server functions (accepting
  191. # connections) and client functions (replicating from a master, establishing
  192. # cluster bus connections, etc.).
  193. #
  194. # Sometimes certificates are issued with attributes that designate them as
  195. # client-only or server-only certificates. In that case it may be desired to use
  196. # different certificates for incoming (server) and outgoing (client)
  197. # connections. To do that, use the following directives:
  198. #
  199. # tls-client-cert-file client.crt
  200. # tls-client-key-file client.key
  201. #
  202. # If the key file is encrypted using a passphrase, it can be included here
  203. # as well.
  204. #
  205. # tls-client-key-file-pass secret
  206. # Configure a DH parameters file to enable Diffie-Hellman (DH) key exchange,
  207. # required by older versions of OpenSSL (<3.0). Newer versions do not require
  208. # this configuration and recommend against it.
  209. #
  210. # tls-dh-params-file redis.dh
  211. # Configure a CA certificate(s) bundle or directory to authenticate TLS/SSL
  212. # clients and peers. Redis requires an explicit configuration of at least one
  213. # of these, and will not implicitly use the system wide configuration.
  214. #
  215. # tls-ca-cert-file ca.crt
  216. # tls-ca-cert-dir /etc/ssl/certs
  217. # By default, clients (including replica servers) on a TLS port are required
  218. # to authenticate using valid client side certificates.
  219. #
  220. # If "no" is specified, client certificates are not required and not accepted.
  221. # If "optional" is specified, client certificates are accepted and must be
  222. # valid if provided, but are not required.
  223. #
  224. # tls-auth-clients no
  225. # tls-auth-clients optional
  226. # By default, a Redis replica does not attempt to establish a TLS connection
  227. # with its master.
  228. #
  229. # Use the following directive to enable TLS on replication links.
  230. #
  231. # tls-replication yes
  232. # By default, the Redis Cluster bus uses a plain TCP connection. To enable
  233. # TLS for the bus protocol, use the following directive:
  234. #
  235. # tls-cluster yes
  236. # By default, only TLSv1.2 and TLSv1.3 are enabled and it is highly recommended
  237. # that older formally deprecated versions are kept disabled to reduce the attack surface.
  238. # You can explicitly specify TLS versions to support.
  239. # Allowed values are case insensitive and include "TLSv1", "TLSv1.1", "TLSv1.2",
  240. # "TLSv1.3" (OpenSSL >= 1.1.1) or any combination.
  241. # To enable only TLSv1.2 and TLSv1.3, use:
  242. #
  243. # tls-protocols "TLSv1.2 TLSv1.3"
  244. # Configure allowed ciphers. See the ciphers(1ssl) manpage for more information
  245. # about the syntax of this string.
  246. #
  247. # Note: this configuration applies only to <= TLSv1.2.
  248. #
  249. # tls-ciphers DEFAULT:!MEDIUM
  250. # Configure allowed TLSv1.3 ciphersuites. See the ciphers(1ssl) manpage for more
  251. # information about the syntax of this string, and specifically for TLSv1.3
  252. # ciphersuites.
  253. #
  254. # tls-ciphersuites TLS_CHACHA20_POLY1305_SHA256
  255. # When choosing a cipher, use the server's preference instead of the client
  256. # preference. By default, the server follows the client's preference.
  257. #
  258. # tls-prefer-server-ciphers yes
  259. # By default, TLS session caching is enabled to allow faster and less expensive
  260. # reconnections by clients that support it. Use the following directive to disable
  261. # caching.
  262. #
  263. # tls-session-caching no
  264. # Change the default number of TLS sessions cached. A zero value sets the cache
  265. # to unlimited size. The default size is 20480.
  266. #
  267. # tls-session-cache-size 5000
  268. # Change the default timeout of cached TLS sessions. The default timeout is 300
  269. # seconds.
  270. #
  271. # tls-session-cache-timeout 60
  272. ################################# GENERAL #####################################
  273. # By default Redis does not run as a daemon. Use 'yes' if you need it.
  274. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
  275. # When Redis is supervised by upstart or systemd, this parameter has no impact.
  276. daemonize no
  277. # If you run Redis from upstart or systemd, Redis can interact with your
  278. # supervision tree. Options:
  279. # supervised no - no supervision interaction
  280. # supervised upstart - signal upstart by putting Redis into SIGSTOP mode
  281. # requires "expect stop" in your upstart job config
  282. # supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
  283. # on startup, and updating Redis status on a regular
  284. # basis.
  285. # supervised auto - detect upstart or systemd method based on
  286. # UPSTART_JOB or NOTIFY_SOCKET environment variables
  287. # Note: these supervision methods only signal "process is ready."
  288. # They do not enable continuous pings back to your supervisor.
  289. #
  290. # The default is "no". To run under upstart/systemd, you can simply uncomment
  291. # the line below:
  292. #
  293. # supervised auto
  294. # If a pid file is specified, Redis writes it where specified at startup
  295. # and removes it at exit.
  296. #
  297. # When the server runs non daemonized, no pid file is created if none is
  298. # specified in the configuration. When the server is daemonized, the pid file
  299. # is used even if not specified, defaulting to "/var/run/redis.pid".
  300. #
  301. # Creating a pid file is best effort: if Redis is not able to create it
  302. # nothing bad happens, the server will start and run normally.
  303. #
  304. # Note that on modern Linux systems "/run/redis.pid" is more conforming
  305. # and should be used instead.
  306. pidfile /var/run/redis_6379.pid
  307. # Specify the server verbosity level.
  308. # This can be one of:
  309. # debug (a lot of information, useful for development/testing)
  310. # verbose (many rarely useful info, but not a mess like the debug level)
  311. # notice (moderately verbose, what you want in production probably)
  312. # warning (only very important / critical messages are logged)
  313. # nothing (nothing is logged)
  314. loglevel notice
  315. # Specify the log file name. Also the empty string can be used to force
  316. # Redis to log on the standard output. Note that if you use standard
  317. # output for logging but daemonize, logs will be sent to /dev/null
  318. logfile ""
  319. # To enable logging to the system logger, just set 'syslog-enabled' to yes,
  320. # and optionally update the other syslog parameters to suit your needs.
  321. # syslog-enabled no
  322. # Specify the syslog identity.
  323. # syslog-ident redis
  324. # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
  325. # syslog-facility local0
  326. # To disable the built in crash log, which will possibly produce cleaner core
  327. # dumps when they are needed, uncomment the following:
  328. #
  329. # crash-log-enabled no
  330. # To disable the fast memory check that's run as part of the crash log, which
  331. # will possibly let redis terminate sooner, uncomment the following:
  332. #
  333. # crash-memcheck-enabled no
  334. # Set the number of databases. The default database is DB 0, you can select
  335. # a different one on a per-connection basis using SELECT <dbid> where
  336. # dbid is a number between 0 and 'databases'-1
  337. databases 16
  338. # By default Redis shows an ASCII art logo only when started to log to the
  339. # standard output and if the standard output is a TTY and syslog logging is
  340. # disabled. Basically this means that normally a logo is displayed only in
  341. # interactive sessions.
  342. #
  343. # However it is possible to force the pre-4.0 behavior and always show a
  344. # ASCII art logo in startup logs by setting the following option to yes.
  345. always-show-logo no
  346. # By default, Redis modifies the process title (as seen in 'top' and 'ps') to
  347. # provide some runtime information. It is possible to disable this and leave
  348. # the process name as executed by setting the following to no.
  349. set-proc-title yes
  350. # When changing the process title, Redis uses the following template to construct
  351. # the modified title.
  352. #
  353. # Template variables are specified in curly brackets. The following variables are
  354. # supported:
  355. #
  356. # {title} Name of process as executed if parent, or type of child process.
  357. # {listen-addr} Bind address or '*' followed by TCP or TLS port listening on, or
  358. # Unix socket if only that's available.
  359. # {server-mode} Special mode, i.e. "[sentinel]" or "[cluster]".
  360. # {port} TCP port listening on, or 0.
  361. # {tls-port} TLS port listening on, or 0.
  362. # {unixsocket} Unix domain socket listening on, or "".
  363. # {config-file} Name of configuration file used.
  364. #
  365. proc-title-template "{title} {listen-addr} {server-mode}"
  366. # Set the local environment which is used for string comparison operations, and
  367. # also affect the performance of Lua scripts. Empty String indicates the locale
  368. # is derived from the environment variables.
  369. locale-collate ""
  370. ################################ SNAPSHOTTING ################################
  371. # Save the DB to disk.
  372. #
  373. # save <seconds> <changes> [<seconds> <changes> ...]
  374. #
  375. # Redis will save the DB if the given number of seconds elapsed and it
  376. # surpassed the given number of write operations against the DB.
  377. #
  378. # Snapshotting can be completely disabled with a single empty string argument
  379. # as in following example:
  380. #
  381. # save ""
  382. #
  383. # Unless specified otherwise, by default Redis will save the DB:
  384. # * After 3600 seconds (an hour) if at least 1 change was performed
  385. # * After 300 seconds (5 minutes) if at least 100 changes were performed
  386. # * After 60 seconds if at least 10000 changes were performed
  387. #
  388. # You can set these explicitly by uncommenting the following line.
  389. #
  390. # save 3600 1 300 100 60 10000
  391. # By default Redis will stop accepting writes if RDB snapshots are enabled
  392. # (at least one save point) and the latest background save failed.
  393. # This will make the user aware (in a hard way) that data is not persisting
  394. # on disk properly, otherwise chances are that no one will notice and some
  395. # disaster will happen.
  396. #
  397. # If the background saving process will start working again Redis will
  398. # automatically allow writes again.
  399. #
  400. # However if you have setup your proper monitoring of the Redis server
  401. # and persistence, you may want to disable this feature so that Redis will
  402. # continue to work as usual even if there are problems with disk,
  403. # permissions, and so forth.
  404. stop-writes-on-bgsave-error yes
  405. # Compress string objects using LZF when dump .rdb databases?
  406. # By default compression is enabled as it's almost always a win.
  407. # If you want to save some CPU in the saving child set it to 'no' but
  408. # the dataset will likely be bigger if you have compressible values or keys.
  409. rdbcompression yes
  410. # Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
  411. # This makes the format more resistant to corruption but there is a performance
  412. # hit to pay (around 10%) when saving and loading RDB files, so you can disable it
  413. # for maximum performances.
  414. #
  415. # RDB files created with checksum disabled have a checksum of zero that will
  416. # tell the loading code to skip the check.
  417. rdbchecksum yes
  418. # Enables or disables full sanitization checks for ziplist and listpack etc when
  419. # loading an RDB or RESTORE payload. This reduces the chances of a assertion or
  420. # crash later on while processing commands.
  421. # Options:
  422. # no - Never perform full sanitization
  423. # yes - Always perform full sanitization
  424. # clients - Perform full sanitization only for user connections.
  425. # Excludes: RDB files, RESTORE commands received from the master
  426. # connection, and client connections which have the
  427. # skip-sanitize-payload ACL flag.
  428. # The default should be 'clients' but since it currently affects cluster
  429. # resharding via MIGRATE, it is temporarily set to 'no' by default.
  430. #
  431. # sanitize-dump-payload no
  432. # The filename where to dump the DB
  433. dbfilename dump.rdb
  434. # Remove RDB files used by replication in instances without persistence
  435. # enabled. By default this option is disabled, however there are environments
  436. # where for regulations or other security concerns, RDB files persisted on
  437. # disk by masters in order to feed replicas, or stored on disk by replicas
  438. # in order to load them for the initial synchronization, should be deleted
  439. # ASAP. Note that this option ONLY WORKS in instances that have both AOF
  440. # and RDB persistence disabled, otherwise is completely ignored.
  441. #
  442. # An alternative (and sometimes better) way to obtain the same effect is
  443. # to use diskless replication on both master and replicas instances. However
  444. # in the case of replicas, diskless is not always an option.
  445. rdb-del-sync-files no
  446. # The working directory.
  447. #
  448. # The DB will be written inside this directory, with the filename specified
  449. # above using the 'dbfilename' configuration directive.
  450. #
  451. # The Append Only File will also be created inside this directory.
  452. #
  453. # Note that you must specify a directory here, not a file name.
  454. dir ./
  455. ################################# REPLICATION #################################
  456. # Master-Replica replication. Use replicaof to make a Redis instance a copy of
  457. # another Redis server. A few things to understand ASAP about Redis replication.
  458. #
  459. # +------------------+ +---------------+
  460. # | Master | ---> | Replica |
  461. # | (receive writes) | | (exact copy) |
  462. # +------------------+ +---------------+
  463. #
  464. # 1) Redis replication is asynchronous, but you can configure a master to
  465. # stop accepting writes if it appears to be not connected with at least
  466. # a given number of replicas.
  467. # 2) Redis replicas are able to perform a partial resynchronization with the
  468. # master if the replication link is lost for a relatively small amount of
  469. # time. You may want to configure the replication backlog size (see the next
  470. # sections of this file) with a sensible value depending on your needs.
  471. # 3) Replication is automatic and does not need user intervention. After a
  472. # network partition replicas automatically try to reconnect to masters
  473. # and resynchronize with them.
  474. #
  475. # replicaof <masterip> <masterport>
  476. # If the master is password protected (using the "requirepass" configuration
  477. # directive below) it is possible to tell the replica to authenticate before
  478. # starting the replication synchronization process, otherwise the master will
  479. # refuse the replica request.
  480. #
  481. # masterauth <master-password>
  482. #
  483. # However this is not enough if you are using Redis ACLs (for Redis version
  484. # 6 or greater), and the default user is not capable of running the PSYNC
  485. # command and/or other commands needed for replication. In this case it's
  486. # better to configure a special user to use with replication, and specify the
  487. # masteruser configuration as such:
  488. #
  489. # masteruser <username>
  490. #
  491. # When masteruser is specified, the replica will authenticate against its
  492. # master using the new AUTH form: AUTH <username> <password>.
  493. # When a replica loses its connection with the master, or when the replication
  494. # is still in progress, the replica can act in two different ways:
  495. #
  496. # 1) if replica-serve-stale-data is set to 'yes' (the default) the replica will
  497. # still reply to client requests, possibly with out of date data, or the
  498. # data set may just be empty if this is the first synchronization.
  499. #
  500. # 2) If replica-serve-stale-data is set to 'no' the replica will reply with error
  501. # "MASTERDOWN Link with MASTER is down and replica-serve-stale-data is set to 'no'"
  502. # to all data access commands, excluding commands such as:
  503. # INFO, REPLICAOF, AUTH, SHUTDOWN, REPLCONF, ROLE, CONFIG, SUBSCRIBE,
  504. # UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB, COMMAND, POST,
  505. # HOST and LATENCY.
  506. #
  507. replica-serve-stale-data yes
  508. # You can configure a replica instance to accept writes or not. Writing against
  509. # a replica instance may be useful to store some ephemeral data (because data
  510. # written on a replica will be easily deleted after resync with the master) but
  511. # may also cause problems if clients are writing to it because of a
  512. # misconfiguration.
  513. #
  514. # Since Redis 2.6 by default replicas are read-only.
  515. #
  516. # Note: read only replicas are not designed to be exposed to untrusted clients
  517. # on the internet. It's just a protection layer against misuse of the instance.
  518. # Still a read only replica exports by default all the administrative commands
  519. # such as CONFIG, DEBUG, and so forth. To a limited extent you can improve
  520. # security of read only replicas using 'rename-command' to shadow all the
  521. # administrative / dangerous commands.
  522. replica-read-only yes
  523. # Replication SYNC strategy: disk or socket.
  524. #
  525. # New replicas and reconnecting replicas that are not able to continue the
  526. # replication process just receiving differences, need to do what is called a
  527. # "full synchronization". An RDB file is transmitted from the master to the
  528. # replicas.
  529. #
  530. # The transmission can happen in two different ways:
  531. #
  532. # 1) Disk-backed: The Redis master creates a new process that writes the RDB
  533. # file on disk. Later the file is transferred by the parent
  534. # process to the replicas incrementally.
  535. # 2) Diskless: The Redis master creates a new process that directly writes the
  536. # RDB file to replica sockets, without touching the disk at all.
  537. #
  538. # With disk-backed replication, while the RDB file is generated, more replicas
  539. # can be queued and served with the RDB file as soon as the current child
  540. # producing the RDB file finishes its work. With diskless replication instead
  541. # once the transfer starts, new replicas arriving will be queued and a new
  542. # transfer will start when the current one terminates.
  543. #
  544. # When diskless replication is used, the master waits a configurable amount of
  545. # time (in seconds) before starting the transfer in the hope that multiple
  546. # replicas will arrive and the transfer can be parallelized.
  547. #
  548. # With slow disks and fast (large bandwidth) networks, diskless replication
  549. # works better.
  550. repl-diskless-sync yes
  551. # When diskless replication is enabled, it is possible to configure the delay
  552. # the server waits in order to spawn the child that transfers the RDB via socket
  553. # to the replicas.
  554. #
  555. # This is important since once the transfer starts, it is not possible to serve
  556. # new replicas arriving, that will be queued for the next RDB transfer, so the
  557. # server waits a delay in order to let more replicas arrive.
  558. #
  559. # The delay is specified in seconds, and by default is 5 seconds. To disable
  560. # it entirely just set it to 0 seconds and the transfer will start ASAP.
  561. repl-diskless-sync-delay 5
  562. # When diskless replication is enabled with a delay, it is possible to let
  563. # the replication start before the maximum delay is reached if the maximum
  564. # number of replicas expected have connected. Default of 0 means that the
  565. # maximum is not defined and Redis will wait the full delay.
  566. repl-diskless-sync-max-replicas 0
  567. # -----------------------------------------------------------------------------
  568. # WARNING: Since in this setup the replica does not immediately store an RDB on
  569. # disk, it may cause data loss during failovers. RDB diskless load + Redis
  570. # modules not handling I/O reads may cause Redis to abort in case of I/O errors
  571. # during the initial synchronization stage with the master.
  572. # -----------------------------------------------------------------------------
  573. #
  574. # Replica can load the RDB it reads from the replication link directly from the
  575. # socket, or store the RDB to a file and read that file after it was completely
  576. # received from the master.
  577. #
  578. # In many cases the disk is slower than the network, and storing and loading
  579. # the RDB file may increase replication time (and even increase the master's
  580. # Copy on Write memory and replica buffers).
  581. # However, when parsing the RDB file directly from the socket, in order to avoid
  582. # data loss it's only safe to flush the current dataset when the new dataset is
  583. # fully loaded in memory, resulting in higher memory usage.
  584. # For this reason we have the following options:
  585. #
  586. # "disabled" - Don't use diskless load (store the rdb file to the disk first)
  587. # "swapdb" - Keep current db contents in RAM while parsing the data directly
  588. # from the socket. Replicas in this mode can keep serving current
  589. # dataset while replication is in progress, except for cases where
  590. # they can't recognize master as having a data set from same
  591. # replication history.
  592. # Note that this requires sufficient memory, if you don't have it,
  593. # you risk an OOM kill.
  594. # "on-empty-db" - Use diskless load only when current dataset is empty. This is
  595. # safer and avoid having old and new dataset loaded side by side
  596. # during replication.
  597. repl-diskless-load disabled
  598. # Master send PINGs to its replicas in a predefined interval. It's possible to
  599. # change this interval with the repl_ping_replica_period option. The default
  600. # value is 10 seconds.
  601. #
  602. # repl-ping-replica-period 10
  603. # The following option sets the replication timeout for:
  604. #
  605. # 1) Bulk transfer I/O during SYNC, from the point of view of replica.
  606. # 2) Master timeout from the point of view of replicas (data, pings).
  607. # 3) Replica timeout from the point of view of masters (REPLCONF ACK pings).
  608. #
  609. # It is important to make sure that this value is greater than the value
  610. # specified for repl-ping-replica-period otherwise a timeout will be detected
  611. # every time there is low traffic between the master and the replica. The default
  612. # value is 60 seconds.
  613. #
  614. # repl-timeout 60
  615. # Disable TCP_NODELAY on the replica socket after SYNC?
  616. #
  617. # If you select "yes" Redis will use a smaller number of TCP packets and
  618. # less bandwidth to send data to replicas. But this can add a delay for
  619. # the data to appear on the replica side, up to 40 milliseconds with
  620. # Linux kernels using a default configuration.
  621. #
  622. # If you select "no" the delay for data to appear on the replica side will
  623. # be reduced but more bandwidth will be used for replication.
  624. #
  625. # By default we optimize for low latency, but in very high traffic conditions
  626. # or when the master and replicas are many hops away, turning this to "yes" may
  627. # be a good idea.
  628. repl-disable-tcp-nodelay no
  629. # Set the replication backlog size. The backlog is a buffer that accumulates
  630. # replica data when replicas are disconnected for some time, so that when a
  631. # replica wants to reconnect again, often a full resync is not needed, but a
  632. # partial resync is enough, just passing the portion of data the replica
  633. # missed while disconnected.
  634. #
  635. # The bigger the replication backlog, the longer the replica can endure the
  636. # disconnect and later be able to perform a partial resynchronization.
  637. #
  638. # The backlog is only allocated if there is at least one replica connected.
  639. #
  640. # repl-backlog-size 1mb
  641. # After a master has no connected replicas for some time, the backlog will be
  642. # freed. The following option configures the amount of seconds that need to
  643. # elapse, starting from the time the last replica disconnected, for the backlog
  644. # buffer to be freed.
  645. #
  646. # Note that replicas never free the backlog for timeout, since they may be
  647. # promoted to masters later, and should be able to correctly "partially
  648. # resynchronize" with other replicas: hence they should always accumulate backlog.
  649. #
  650. # A value of 0 means to never release the backlog.
  651. #
  652. # repl-backlog-ttl 3600
  653. # The replica priority is an integer number published by Redis in the INFO
  654. # output. It is used by Redis Sentinel in order to select a replica to promote
  655. # into a master if the master is no longer working correctly.
  656. #
  657. # A replica with a low priority number is considered better for promotion, so
  658. # for instance if there are three replicas with priority 10, 100, 25 Sentinel
  659. # will pick the one with priority 10, that is the lowest.
  660. #
  661. # However a special priority of 0 marks the replica as not able to perform the
  662. # role of master, so a replica with priority of 0 will never be selected by
  663. # Redis Sentinel for promotion.
  664. #
  665. # By default the priority is 100.
  666. replica-priority 100
  667. # The propagation error behavior controls how Redis will behave when it is
  668. # unable to handle a command being processed in the replication stream from a master
  669. # or processed while reading from an AOF file. Errors that occur during propagation
  670. # are unexpected, and can cause data inconsistency. However, there are edge cases
  671. # in earlier versions of Redis where it was possible for the server to replicate or persist
  672. # commands that would fail on future versions. For this reason the default behavior
  673. # is to ignore such errors and continue processing commands.
  674. #
  675. # If an application wants to ensure there is no data divergence, this configuration
  676. # should be set to 'panic' instead. The value can also be set to 'panic-on-replicas'
  677. # to only panic when a replica encounters an error on the replication stream. One of
  678. # these two panic values will become the default value in the future once there are
  679. # sufficient safety mechanisms in place to prevent false positive crashes.
  680. #
  681. # propagation-error-behavior ignore
  682. # Replica ignore disk write errors controls the behavior of a replica when it is
  683. # unable to persist a write command received from its master to disk. By default,
  684. # this configuration is set to 'no' and will crash the replica in this condition.
  685. # It is not recommended to change this default, however in order to be compatible
  686. # with older versions of Redis this config can be toggled to 'yes' which will just
  687. # log a warning and execute the write command it got from the master.
  688. #
  689. # replica-ignore-disk-write-errors no
  690. # -----------------------------------------------------------------------------
  691. # By default, Redis Sentinel includes all replicas in its reports. A replica
  692. # can be excluded from Redis Sentinel's announcements. An unannounced replica
  693. # will be ignored by the 'sentinel replicas <master>' command and won't be
  694. # exposed to Redis Sentinel's clients.
  695. #
  696. # This option does not change the behavior of replica-priority. Even with
  697. # replica-announced set to 'no', the replica can be promoted to master. To
  698. # prevent this behavior, set replica-priority to 0.
  699. #
  700. # replica-announced yes
  701. # It is possible for a master to stop accepting writes if there are less than
  702. # N replicas connected, having a lag less or equal than M seconds.
  703. #
  704. # The N replicas need to be in "online" state.
  705. #
  706. # The lag in seconds, that must be <= the specified value, is calculated from
  707. # the last ping received from the replica, that is usually sent every second.
  708. #
  709. # This option does not GUARANTEE that N replicas will accept the write, but
  710. # will limit the window of exposure for lost writes in case not enough replicas
  711. # are available, to the specified number of seconds.
  712. #
  713. # For example to require at least 3 replicas with a lag <= 10 seconds use:
  714. #
  715. # min-replicas-to-write 3
  716. # min-replicas-max-lag 10
  717. #
  718. # Setting one or the other to 0 disables the feature.
  719. #
  720. # By default min-replicas-to-write is set to 0 (feature disabled) and
  721. # min-replicas-max-lag is set to 10.
  722. # A Redis master is able to list the address and port of the attached
  723. # replicas in different ways. For example the "INFO replication" section
  724. # offers this information, which is used, among other tools, by
  725. # Redis Sentinel in order to discover replica instances.
  726. # Another place where this info is available is in the output of the
  727. # "ROLE" command of a master.
  728. #
  729. # The listed IP address and port normally reported by a replica is
  730. # obtained in the following way:
  731. #
  732. # IP: The address is auto detected by checking the peer address
  733. # of the socket used by the replica to connect with the master.
  734. #
  735. # Port: The port is communicated by the replica during the replication
  736. # handshake, and is normally the port that the replica is using to
  737. # listen for connections.
  738. #
  739. # However when port forwarding or Network Address Translation (NAT) is
  740. # used, the replica may actually be reachable via different IP and port
  741. # pairs. The following two options can be used by a replica in order to
  742. # report to its master a specific set of IP and port, so that both INFO
  743. # and ROLE will report those values.
  744. #
  745. # There is no need to use both the options if you need to override just
  746. # the port or the IP address.
  747. #
  748. # replica-announce-ip 5.5.5.5
  749. # replica-announce-port 1234
  750. ############################### KEYS TRACKING #################################
  751. # Redis implements server assisted support for client side caching of values.
  752. # This is implemented using an invalidation table that remembers, using
  753. # a radix key indexed by key name, what clients have which keys. In turn
  754. # this is used in order to send invalidation messages to clients. Please
  755. # check this page to understand more about the feature:
  756. #
  757. # https://redis.io/topics/client-side-caching
  758. #
  759. # When tracking is enabled for a client, all the read only queries are assumed
  760. # to be cached: this will force Redis to store information in the invalidation
  761. # table. When keys are modified, such information is flushed away, and
  762. # invalidation messages are sent to the clients. However if the workload is
  763. # heavily dominated by reads, Redis could use more and more memory in order
  764. # to track the keys fetched by many clients.
  765. #
  766. # For this reason it is possible to configure a maximum fill value for the
  767. # invalidation table. By default it is set to 1M of keys, and once this limit
  768. # is reached, Redis will start to evict keys in the invalidation table
  769. # even if they were not modified, just to reclaim memory: this will in turn
  770. # force the clients to invalidate the cached values. Basically the table
  771. # maximum size is a trade off between the memory you want to spend server
  772. # side to track information about who cached what, and the ability of clients
  773. # to retain cached objects in memory.
  774. #
  775. # If you set the value to 0, it means there are no limits, and Redis will
  776. # retain as many keys as needed in the invalidation table.
  777. # In the "stats" INFO section, you can find information about the number of
  778. # keys in the invalidation table at every given moment.
  779. #
  780. # Note: when key tracking is used in broadcasting mode, no memory is used
  781. # in the server side so this setting is useless.
  782. #
  783. # tracking-table-max-keys 1000000
  784. ################################## SECURITY ###################################
  785. # Warning: since Redis is pretty fast, an outside user can try up to
  786. # 1 million passwords per second against a modern box. This means that you
  787. # should use very strong passwords, otherwise they will be very easy to break.
  788. # Note that because the password is really a shared secret between the client
  789. # and the server, and should not be memorized by any human, the password
  790. # can be easily a long string from /dev/urandom or whatever, so by using a
  791. # long and unguessable password no brute force attack will be possible.
  792. # Redis ACL users are defined in the following format:
  793. #
  794. # user <username> ... acl rules ...
  795. #
  796. # For example:
  797. #
  798. # user worker +@list +@connection ~jobs:* on >ffa9203c493aa99
  799. #
  800. # The special username "default" is used for new connections. If this user
  801. # has the "nopass" rule, then new connections will be immediately authenticated
  802. # as the "default" user without the need of any password provided via the
  803. # AUTH command. Otherwise if the "default" user is not flagged with "nopass"
  804. # the connections will start in not authenticated state, and will require
  805. # AUTH (or the HELLO command AUTH option) in order to be authenticated and
  806. # start to work.
  807. #
  808. # The ACL rules that describe what a user can do are the following:
  809. #
  810. # on Enable the user: it is possible to authenticate as this user.
  811. # off Disable the user: it's no longer possible to authenticate
  812. # with this user, however the already authenticated connections
  813. # will still work.
  814. # skip-sanitize-payload RESTORE dump-payload sanitization is skipped.
  815. # sanitize-payload RESTORE dump-payload is sanitized (default).
  816. # +<command> Allow the execution of that command.
  817. # May be used with `|` for allowing subcommands (e.g "+config|get")
  818. # -<command> Disallow the execution of that command.
  819. # May be used with `|` for blocking subcommands (e.g "-config|set")
  820. # +@<category> Allow the execution of all the commands in such category
  821. # with valid categories are like @admin, @set, @sortedset, ...
  822. # and so forth, see the full list in the server.c file where
  823. # the Redis command table is described and defined.
  824. # The special category @all means all the commands, but currently
  825. # present in the server, and that will be loaded in the future
  826. # via modules.
  827. # +<command>|first-arg Allow a specific first argument of an otherwise
  828. # disabled command. It is only supported on commands with
  829. # no sub-commands, and is not allowed as negative form
  830. # like -SELECT|1, only additive starting with "+". This
  831. # feature is deprecated and may be removed in the future.
  832. # allcommands Alias for +@all. Note that it implies the ability to execute
  833. # all the future commands loaded via the modules system.
  834. # nocommands Alias for -@all.
  835. # ~<pattern> Add a pattern of keys that can be mentioned as part of
  836. # commands. For instance ~* allows all the keys. The pattern
  837. # is a glob-style pattern like the one of KEYS.
  838. # It is possible to specify multiple patterns.
  839. # %R~<pattern> Add key read pattern that specifies which keys can be read
  840. # from.
  841. # %W~<pattern> Add key write pattern that specifies which keys can be
  842. # written to.
  843. # allkeys Alias for ~*
  844. # resetkeys Flush the list of allowed keys patterns.
  845. # &<pattern> Add a glob-style pattern of Pub/Sub channels that can be
  846. # accessed by the user. It is possible to specify multiple channel
  847. # patterns.
  848. # allchannels Alias for &*
  849. # resetchannels Flush the list of allowed channel patterns.
  850. # ><password> Add this password to the list of valid password for the user.
  851. # For example >mypass will add "mypass" to the list.
  852. # This directive clears the "nopass" flag (see later).
  853. # <<password> Remove this password from the list of valid passwords.
  854. # nopass All the set passwords of the user are removed, and the user
  855. # is flagged as requiring no password: it means that every
  856. # password will work against this user. If this directive is
  857. # used for the default user, every new connection will be
  858. # immediately authenticated with the default user without
  859. # any explicit AUTH command required. Note that the "resetpass"
  860. # directive will clear this condition.
  861. # resetpass Flush the list of allowed passwords. Moreover removes the
  862. # "nopass" status. After "resetpass" the user has no associated
  863. # passwords and there is no way to authenticate without adding
  864. # some password (or setting it as "nopass" later).
  865. # reset Performs the following actions: resetpass, resetkeys, resetchannels,
  866. # allchannels (if acl-pubsub-default is set), off, clearselectors, -@all.
  867. # The user returns to the same state it has immediately after its creation.
  868. # (<options>) Create a new selector with the options specified within the
  869. # parentheses and attach it to the user. Each option should be
  870. # space separated. The first character must be ( and the last
  871. # character must be ).
  872. # clearselectors Remove all of the currently attached selectors.
  873. # Note this does not change the "root" user permissions,
  874. # which are the permissions directly applied onto the
  875. # user (outside the parentheses).
  876. #
  877. # ACL rules can be specified in any order: for instance you can start with
  878. # passwords, then flags, or key patterns. However note that the additive
  879. # and subtractive rules will CHANGE MEANING depending on the ordering.
  880. # For instance see the following example:
  881. #
  882. # user alice on +@all -DEBUG ~* >somepassword
  883. #
  884. # This will allow "alice" to use all the commands with the exception of the
  885. # DEBUG command, since +@all added all the commands to the set of the commands
  886. # alice can use, and later DEBUG was removed. However if we invert the order
  887. # of two ACL rules the result will be different:
  888. #
  889. # user alice on -DEBUG +@all ~* >somepassword
  890. #
  891. # Now DEBUG was removed when alice had yet no commands in the set of allowed
  892. # commands, later all the commands are added, so the user will be able to
  893. # execute everything.
  894. #
  895. # Basically ACL rules are processed left-to-right.
  896. #
  897. # The following is a list of command categories and their meanings:
  898. # * keyspace - Writing or reading from keys, databases, or their metadata
  899. # in a type agnostic way. Includes DEL, RESTORE, DUMP, RENAME, EXISTS, DBSIZE,
  900. # KEYS, EXPIRE, TTL, FLUSHALL, etc. Commands that may modify the keyspace,
  901. # key or metadata will also have `write` category. Commands that only read
  902. # the keyspace, key or metadata will have the `read` category.
  903. # * read - Reading from keys (values or metadata). Note that commands that don't
  904. # interact with keys, will not have either `read` or `write`.
  905. # * write - Writing to keys (values or metadata)
  906. # * admin - Administrative commands. Normal applications will never need to use
  907. # these. Includes REPLICAOF, CONFIG, DEBUG, SAVE, MONITOR, ACL, SHUTDOWN, etc.
  908. # * dangerous - Potentially dangerous (each should be considered with care for
  909. # various reasons). This includes FLUSHALL, MIGRATE, RESTORE, SORT, KEYS,
  910. # CLIENT, DEBUG, INFO, CONFIG, SAVE, REPLICAOF, etc.
  911. # * connection - Commands affecting the connection or other connections.
  912. # This includes AUTH, SELECT, COMMAND, CLIENT, ECHO, PING, etc.
  913. # * blocking - Potentially blocking the connection until released by another
  914. # command.
  915. # * fast - Fast O(1) commands. May loop on the number of arguments, but not the
  916. # number of elements in the key.
  917. # * slow - All commands that are not Fast.
  918. # * pubsub - PUBLISH / SUBSCRIBE related
  919. # * transaction - WATCH / MULTI / EXEC related commands.
  920. # * scripting - Scripting related.
  921. # * set - Data type: sets related.
  922. # * sortedset - Data type: zsets related.
  923. # * list - Data type: lists related.
  924. # * hash - Data type: hashes related.
  925. # * string - Data type: strings related.
  926. # * bitmap - Data type: bitmaps related.
  927. # * hyperloglog - Data type: hyperloglog related.
  928. # * geo - Data type: geo related.
  929. # * stream - Data type: streams related.
  930. #
  931. # For more information about ACL configuration please refer to
  932. # the Redis web site at https://redis.io/topics/acl
  933. # ACL LOG
  934. #
  935. # The ACL Log tracks failed commands and authentication events associated
  936. # with ACLs. The ACL Log is useful to troubleshoot failed commands blocked
  937. # by ACLs. The ACL Log is stored in memory. You can reclaim memory with
  938. # ACL LOG RESET. Define the maximum entry length of the ACL Log below.
  939. acllog-max-len 128
  940. # Using an external ACL file
  941. #
  942. # Instead of configuring users here in this file, it is possible to use
  943. # a stand-alone file just listing users. The two methods cannot be mixed:
  944. # if you configure users here and at the same time you activate the external
  945. # ACL file, the server will refuse to start.
  946. #
  947. # The format of the external ACL user file is exactly the same as the
  948. # format that is used inside redis.conf to describe users.
  949. #
  950. # aclfile /etc/redis/users.acl
  951. # IMPORTANT NOTE: starting with Redis 6 "requirepass" is just a compatibility
  952. # layer on top of the new ACL system. The option effect will be just setting
  953. # the password for the default user. Clients will still authenticate using
  954. # AUTH <password> as usually, or more explicitly with AUTH default <password>
  955. # if they follow the new protocol: both will work.
  956. #
  957. # The requirepass is not compatible with aclfile option and the ACL LOAD
  958. # command, these will cause requirepass to be ignored.
  959. #
  960. requirepass 8756redis2024
  961. # New users are initialized with restrictive permissions by default, via the
  962. # equivalent of this ACL rule 'off resetkeys -@all'. Starting with Redis 6.2, it
  963. # is possible to manage access to Pub/Sub channels with ACL rules as well. The
  964. # default Pub/Sub channels permission if new users is controlled by the
  965. # acl-pubsub-default configuration directive, which accepts one of these values:
  966. #
  967. # allchannels: grants access to all Pub/Sub channels
  968. # resetchannels: revokes access to all Pub/Sub channels
  969. #
  970. # From Redis 7.0, acl-pubsub-default defaults to 'resetchannels' permission.
  971. #
  972. # acl-pubsub-default resetchannels
  973. # Command renaming (DEPRECATED).
  974. #
  975. # ------------------------------------------------------------------------
  976. # WARNING: avoid using this option if possible. Instead use ACLs to remove
  977. # commands from the default user, and put them only in some admin user you
  978. # create for administrative purposes.
  979. # ------------------------------------------------------------------------
  980. #
  981. # It is possible to change the name of dangerous commands in a shared
  982. # environment. For instance the CONFIG command may be renamed into something
  983. # hard to guess so that it will still be available for internal-use tools
  984. # but not available for general clients.
  985. #
  986. # Example:
  987. #
  988. # rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
  989. #
  990. # It is also possible to completely kill a command by renaming it into
  991. # an empty string:
  992. #
  993. # rename-command CONFIG ""
  994. #
  995. # Please note that changing the name of commands that are logged into the
  996. # AOF file or transmitted to replicas may cause problems.
  997. ################################### CLIENTS ####################################
  998. # Set the max number of connected clients at the same time. By default
  999. # this limit is set to 10000 clients, however if the Redis server is not
  1000. # able to configure the process file limit to allow for the specified limit
  1001. # the max number of allowed clients is set to the current file limit
  1002. # minus 32 (as Redis reserves a few file descriptors for internal uses).
  1003. #
  1004. # Once the limit is reached Redis will close all the new connections sending
  1005. # an error 'max number of clients reached'.
  1006. #
  1007. # IMPORTANT: When Redis Cluster is used, the max number of connections is also
  1008. # shared with the cluster bus: every node in the cluster will use two
  1009. # connections, one incoming and another outgoing. It is important to size the
  1010. # limit accordingly in case of very large clusters.
  1011. #
  1012. # maxclients 10000
  1013. ############################## MEMORY MANAGEMENT ################################
  1014. # Set a memory usage limit to the specified amount of bytes.
  1015. # When the memory limit is reached Redis will try to remove keys
  1016. # according to the eviction policy selected (see maxmemory-policy).
  1017. #
  1018. # If Redis can't remove keys according to the policy, or if the policy is
  1019. # set to 'noeviction', Redis will start to reply with errors to commands
  1020. # that would use more memory, like SET, LPUSH, and so on, and will continue
  1021. # to reply to read-only commands like GET.
  1022. #
  1023. # This option is usually useful when using Redis as an LRU or LFU cache, or to
  1024. # set a hard memory limit for an instance (using the 'noeviction' policy).
  1025. #
  1026. # WARNING: If you have replicas attached to an instance with maxmemory on,
  1027. # the size of the output buffers needed to feed the replicas are subtracted
  1028. # from the used memory count, so that network problems / resyncs will
  1029. # not trigger a loop where keys are evicted, and in turn the output
  1030. # buffer of replicas is full with DELs of keys evicted triggering the deletion
  1031. # of more keys, and so forth until the database is completely emptied.
  1032. #
  1033. # In short... if you have replicas attached it is suggested that you set a lower
  1034. # limit for maxmemory so that there is some free RAM on the system for replica
  1035. # output buffers (but this is not needed if the policy is 'noeviction').
  1036. #
  1037. # maxmemory <bytes>
  1038. # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
  1039. # is reached. You can select one from the following behaviors:
  1040. #
  1041. # volatile-lru -> Evict using approximated LRU, only keys with an expire set.
  1042. # allkeys-lru -> Evict any key using approximated LRU.
  1043. # volatile-lfu -> Evict using approximated LFU, only keys with an expire set.
  1044. # allkeys-lfu -> Evict any key using approximated LFU.
  1045. # volatile-random -> Remove a random key having an expire set.
  1046. # allkeys-random -> Remove a random key, any key.
  1047. # volatile-ttl -> Remove the key with the nearest expire time (minor TTL)
  1048. # noeviction -> Don't evict anything, just return an error on write operations.
  1049. #
  1050. # LRU means Least Recently Used
  1051. # LFU means Least Frequently Used
  1052. #
  1053. # Both LRU, LFU and volatile-ttl are implemented using approximated
  1054. # randomized algorithms.
  1055. #
  1056. # Note: with any of the above policies, when there are no suitable keys for
  1057. # eviction, Redis will return an error on write operations that require
  1058. # more memory. These are usually commands that create new keys, add data or
  1059. # modify existing keys. A few examples are: SET, INCR, HSET, LPUSH, SUNIONSTORE,
  1060. # SORT (due to the STORE argument), and EXEC (if the transaction includes any
  1061. # command that requires memory).
  1062. #
  1063. # The default is:
  1064. #
  1065. # maxmemory-policy noeviction
  1066. # LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated
  1067. # algorithms (in order to save memory), so you can tune it for speed or
  1068. # accuracy. By default Redis will check five keys and pick the one that was
  1069. # used least recently, you can change the sample size using the following
  1070. # configuration directive.
  1071. #
  1072. # The default of 5 produces good enough results. 10 Approximates very closely
  1073. # true LRU but costs more CPU. 3 is faster but not very accurate. The maximum
  1074. # value that can be set is 64.
  1075. #
  1076. # maxmemory-samples 5
  1077. # Eviction processing is designed to function well with the default setting.
  1078. # If there is an unusually large amount of write traffic, this value may need to
  1079. # be increased. Decreasing this value may reduce latency at the risk of
  1080. # eviction processing effectiveness
  1081. # 0 = minimum latency, 10 = default, 100 = process without regard to latency
  1082. #
  1083. # maxmemory-eviction-tenacity 10
  1084. # Starting from Redis 5, by default a replica will ignore its maxmemory setting
  1085. # (unless it is promoted to master after a failover or manually). It means
  1086. # that the eviction of keys will be just handled by the master, sending the
  1087. # DEL commands to the replica as keys evict in the master side.
  1088. #
  1089. # This behavior ensures that masters and replicas stay consistent, and is usually
  1090. # what you want, however if your replica is writable, or you want the replica
  1091. # to have a different memory setting, and you are sure all the writes performed
  1092. # to the replica are idempotent, then you may change this default (but be sure
  1093. # to understand what you are doing).
  1094. #
  1095. # Note that since the replica by default does not evict, it may end using more
  1096. # memory than the one set via maxmemory (there are certain buffers that may
  1097. # be larger on the replica, or data structures may sometimes take more memory
  1098. # and so forth). So make sure you monitor your replicas and make sure they
  1099. # have enough memory to never hit a real out-of-memory condition before the
  1100. # master hits the configured maxmemory setting.
  1101. #
  1102. # replica-ignore-maxmemory yes
  1103. # Redis reclaims expired keys in two ways: upon access when those keys are
  1104. # found to be expired, and also in background, in what is called the
  1105. # "active expire key". The key space is slowly and interactively scanned
  1106. # looking for expired keys to reclaim, so that it is possible to free memory
  1107. # of keys that are expired and will never be accessed again in a short time.
  1108. #
  1109. # The default effort of the expire cycle will try to avoid having more than
  1110. # ten percent of expired keys still in memory, and will try to avoid consuming
  1111. # more than 25% of total memory and to add latency to the system. However
  1112. # it is possible to increase the expire "effort" that is normally set to
  1113. # "1", to a greater value, up to the value "10". At its maximum value the
  1114. # system will use more CPU, longer cycles (and technically may introduce
  1115. # more latency), and will tolerate less already expired keys still present
  1116. # in the system. It's a tradeoff between memory, CPU and latency.
  1117. #
  1118. # active-expire-effort 1
  1119. ############################# LAZY FREEING ####################################
  1120. # Redis has two primitives to delete keys. One is called DEL and is a blocking
  1121. # deletion of the object. It means that the server stops processing new commands
  1122. # in order to reclaim all the memory associated with an object in a synchronous
  1123. # way. If the key deleted is associated with a small object, the time needed
  1124. # in order to execute the DEL command is very small and comparable to most other
  1125. # O(1) or O(log_N) commands in Redis. However if the key is associated with an
  1126. # aggregated value containing millions of elements, the server can block for
  1127. # a long time (even seconds) in order to complete the operation.
  1128. #
  1129. # For the above reasons Redis also offers non blocking deletion primitives
  1130. # such as UNLINK (non blocking DEL) and the ASYNC option of FLUSHALL and
  1131. # FLUSHDB commands, in order to reclaim memory in background. Those commands
  1132. # are executed in constant time. Another thread will incrementally free the
  1133. # object in the background as fast as possible.
  1134. #
  1135. # DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled.
  1136. # It's up to the design of the application to understand when it is a good
  1137. # idea to use one or the other. However the Redis server sometimes has to
  1138. # delete keys or flush the whole database as a side effect of other operations.
  1139. # Specifically Redis deletes objects independently of a user call in the
  1140. # following scenarios:
  1141. #
  1142. # 1) On eviction, because of the maxmemory and maxmemory policy configurations,
  1143. # in order to make room for new data, without going over the specified
  1144. # memory limit.
  1145. # 2) Because of expire: when a key with an associated time to live (see the
  1146. # EXPIRE command) must be deleted from memory.
  1147. # 3) Because of a side effect of a command that stores data on a key that may
  1148. # already exist. For example the RENAME command may delete the old key
  1149. # content when it is replaced with another one. Similarly SUNIONSTORE
  1150. # or SORT with STORE option may delete existing keys. The SET command
  1151. # itself removes any old content of the specified key in order to replace
  1152. # it with the specified string.
  1153. # 4) During replication, when a replica performs a full resynchronization with
  1154. # its master, the content of the whole database is removed in order to
  1155. # load the RDB file just transferred.
  1156. #
  1157. # In all the above cases the default is to delete objects in a blocking way,
  1158. # like if DEL was called. However you can configure each case specifically
  1159. # in order to instead release memory in a non-blocking way like if UNLINK
  1160. # was called, using the following configuration directives.
  1161. lazyfree-lazy-eviction no
  1162. lazyfree-lazy-expire no
  1163. lazyfree-lazy-server-del no
  1164. replica-lazy-flush no
  1165. # It is also possible, for the case when to replace the user code DEL calls
  1166. # with UNLINK calls is not easy, to modify the default behavior of the DEL
  1167. # command to act exactly like UNLINK, using the following configuration
  1168. # directive:
  1169. lazyfree-lazy-user-del no
  1170. # FLUSHDB, FLUSHALL, SCRIPT FLUSH and FUNCTION FLUSH support both asynchronous and synchronous
  1171. # deletion, which can be controlled by passing the [SYNC|ASYNC] flags into the
  1172. # commands. When neither flag is passed, this directive will be used to determine
  1173. # if the data should be deleted asynchronously.
  1174. lazyfree-lazy-user-flush no
  1175. ################################ THREADED I/O #################################
  1176. # Redis is mostly single threaded, however there are certain threaded
  1177. # operations such as UNLINK, slow I/O accesses and other things that are
  1178. # performed on side threads.
  1179. #
  1180. # Now it is also possible to handle Redis clients socket reads and writes
  1181. # in different I/O threads. Since especially writing is so slow, normally
  1182. # Redis users use pipelining in order to speed up the Redis performances per
  1183. # core, and spawn multiple instances in order to scale more. Using I/O
  1184. # threads it is possible to easily speedup two times Redis without resorting
  1185. # to pipelining nor sharding of the instance.
  1186. #
  1187. # By default threading is disabled, we suggest enabling it only in machines
  1188. # that have at least 4 or more cores, leaving at least one spare core.
  1189. # Using more than 8 threads is unlikely to help much. We also recommend using
  1190. # threaded I/O only if you actually have performance problems, with Redis
  1191. # instances being able to use a quite big percentage of CPU time, otherwise
  1192. # there is no point in using this feature.
  1193. #
  1194. # So for instance if you have a four cores boxes, try to use 2 or 3 I/O
  1195. # threads, if you have a 8 cores, try to use 6 threads. In order to
  1196. # enable I/O threads use the following configuration directive:
  1197. #
  1198. # io-threads 4
  1199. #
  1200. # Setting io-threads to 1 will just use the main thread as usual.
  1201. # When I/O threads are enabled, we only use threads for writes, that is
  1202. # to thread the write(2) syscall and transfer the client buffers to the
  1203. # socket. However it is also possible to enable threading of reads and
  1204. # protocol parsing using the following configuration directive, by setting
  1205. # it to yes:
  1206. #
  1207. # io-threads-do-reads no
  1208. #
  1209. # Usually threading reads doesn't help much.
  1210. #
  1211. # NOTE 1: This configuration directive cannot be changed at runtime via
  1212. # CONFIG SET. Also, this feature currently does not work when SSL is
  1213. # enabled.
  1214. #
  1215. # NOTE 2: If you want to test the Redis speedup using redis-benchmark, make
  1216. # sure you also run the benchmark itself in threaded mode, using the
  1217. # --threads option to match the number of Redis threads, otherwise you'll not
  1218. # be able to notice the improvements.
  1219. ############################ KERNEL OOM CONTROL ##############################
  1220. # On Linux, it is possible to hint the kernel OOM killer on what processes
  1221. # should be killed first when out of memory.
  1222. #
  1223. # Enabling this feature makes Redis actively control the oom_score_adj value
  1224. # for all its processes, depending on their role. The default scores will
  1225. # attempt to have background child processes killed before all others, and
  1226. # replicas killed before masters.
  1227. #
  1228. # Redis supports these options:
  1229. #
  1230. # no: Don't make changes to oom-score-adj (default).
  1231. # yes: Alias to "relative" see below.
  1232. # absolute: Values in oom-score-adj-values are written as is to the kernel.
  1233. # relative: Values are used relative to the initial value of oom_score_adj when
  1234. # the server starts and are then clamped to a range of -1000 to 1000.
  1235. # Because typically the initial value is 0, they will often match the
  1236. # absolute values.
  1237. oom-score-adj no
  1238. # When oom-score-adj is used, this directive controls the specific values used
  1239. # for master, replica and background child processes. Values range -2000 to
  1240. # 2000 (higher means more likely to be killed).
  1241. #
  1242. # Unprivileged processes (not root, and without CAP_SYS_RESOURCE capabilities)
  1243. # can freely increase their value, but not decrease it below its initial
  1244. # settings. This means that setting oom-score-adj to "relative" and setting the
  1245. # oom-score-adj-values to positive values will always succeed.
  1246. oom-score-adj-values 0 200 800
  1247. #################### KERNEL transparent hugepage CONTROL ######################
  1248. # Usually the kernel Transparent Huge Pages control is set to "madvise" or
  1249. # or "never" by default (/sys/kernel/mm/transparent_hugepage/enabled), in which
  1250. # case this config has no effect. On systems in which it is set to "always",
  1251. # redis will attempt to disable it specifically for the redis process in order
  1252. # to avoid latency problems specifically with fork(2) and CoW.
  1253. # If for some reason you prefer to keep it enabled, you can set this config to
  1254. # "no" and the kernel global to "always".
  1255. disable-thp yes
  1256. ############################## APPEND ONLY MODE ###############################
  1257. # By default Redis asynchronously dumps the dataset on disk. This mode is
  1258. # good enough in many applications, but an issue with the Redis process or
  1259. # a power outage may result into a few minutes of writes lost (depending on
  1260. # the configured save points).
  1261. #
  1262. # The Append Only File is an alternative persistence mode that provides
  1263. # much better durability. For instance using the default data fsync policy
  1264. # (see later in the config file) Redis can lose just one second of writes in a
  1265. # dramatic event like a server power outage, or a single write if something
  1266. # wrong with the Redis process itself happens, but the operating system is
  1267. # still running correctly.
  1268. #
  1269. # AOF and RDB persistence can be enabled at the same time without problems.
  1270. # If the AOF is enabled on startup Redis will load the AOF, that is the file
  1271. # with the better durability guarantees.
  1272. #
  1273. # Note that changing this value in a config file of an existing database and
  1274. # restarting the server can lead to data loss. A conversion needs to be done
  1275. # by setting it via CONFIG command on a live server first.
  1276. #
  1277. # Please check https://redis.io/topics/persistence for more information.
  1278. appendonly no
  1279. # The base name of the append only file.
  1280. #
  1281. # Redis 7 and newer use a set of append-only files to persist the dataset
  1282. # and changes applied to it. There are two basic types of files in use:
  1283. #
  1284. # - Base files, which are a snapshot representing the complete state of the
  1285. # dataset at the time the file was created. Base files can be either in
  1286. # the form of RDB (binary serialized) or AOF (textual commands).
  1287. # - Incremental files, which contain additional commands that were applied
  1288. # to the dataset following the previous file.
  1289. #
  1290. # In addition, manifest files are used to track the files and the order in
  1291. # which they were created and should be applied.
  1292. #
  1293. # Append-only file names are created by Redis following a specific pattern.
  1294. # The file name's prefix is based on the 'appendfilename' configuration
  1295. # parameter, followed by additional information about the sequence and type.
  1296. #
  1297. # For example, if appendfilename is set to appendonly.aof, the following file
  1298. # names could be derived:
  1299. #
  1300. # - appendonly.aof.1.base.rdb as a base file.
  1301. # - appendonly.aof.1.incr.aof, appendonly.aof.2.incr.aof as incremental files.
  1302. # - appendonly.aof.manifest as a manifest file.
  1303. appendfilename "appendonly.aof"
  1304. # For convenience, Redis stores all persistent append-only files in a dedicated
  1305. # directory. The name of the directory is determined by the appenddirname
  1306. # configuration parameter.
  1307. appenddirname "appendonlydir"
  1308. # The fsync() call tells the Operating System to actually write data on disk
  1309. # instead of waiting for more data in the output buffer. Some OS will really flush
  1310. # data on disk, some other OS will just try to do it ASAP.
  1311. #
  1312. # Redis supports three different modes:
  1313. #
  1314. # no: don't fsync, just let the OS flush the data when it wants. Faster.
  1315. # always: fsync after every write to the append only log. Slow, Safest.
  1316. # everysec: fsync only one time every second. Compromise.
  1317. #
  1318. # The default is "everysec", as that's usually the right compromise between
  1319. # speed and data safety. It's up to you to understand if you can relax this to
  1320. # "no" that will let the operating system flush the output buffer when
  1321. # it wants, for better performances (but if you can live with the idea of
  1322. # some data loss consider the default persistence mode that's snapshotting),
  1323. # or on the contrary, use "always" that's very slow but a bit safer than
  1324. # everysec.
  1325. #
  1326. # More details please check the following article:
  1327. # http://antirez.com/post/redis-persistence-demystified.html
  1328. #
  1329. # If unsure, use "everysec".
  1330. # appendfsync always
  1331. appendfsync everysec
  1332. # appendfsync no
  1333. # When the AOF fsync policy is set to always or everysec, and a background
  1334. # saving process (a background save or AOF log background rewriting) is
  1335. # performing a lot of I/O against the disk, in some Linux configurations
  1336. # Redis may block too long on the fsync() call. Note that there is no fix for
  1337. # this currently, as even performing fsync in a different thread will block
  1338. # our synchronous write(2) call.
  1339. #
  1340. # In order to mitigate this problem it's possible to use the following option
  1341. # that will prevent fsync() from being called in the main process while a
  1342. # BGSAVE or BGREWRITEAOF is in progress.
  1343. #
  1344. # This means that while another child is saving, the durability of Redis is
  1345. # the same as "appendfsync no". In practical terms, this means that it is
  1346. # possible to lose up to 30 seconds of log in the worst scenario (with the
  1347. # default Linux settings).
  1348. #
  1349. # If you have latency problems turn this to "yes". Otherwise leave it as
  1350. # "no" that is the safest pick from the point of view of durability.
  1351. no-appendfsync-on-rewrite no
  1352. # Automatic rewrite of the append only file.
  1353. # Redis is able to automatically rewrite the log file implicitly calling
  1354. # BGREWRITEAOF when the AOF log size grows by the specified percentage.
  1355. #
  1356. # This is how it works: Redis remembers the size of the AOF file after the
  1357. # latest rewrite (if no rewrite has happened since the restart, the size of
  1358. # the AOF at startup is used).
  1359. #
  1360. # This base size is compared to the current size. If the current size is
  1361. # bigger than the specified percentage, the rewrite is triggered. Also
  1362. # you need to specify a minimal size for the AOF file to be rewritten, this
  1363. # is useful to avoid rewriting the AOF file even if the percentage increase
  1364. # is reached but it is still pretty small.
  1365. #
  1366. # Specify a percentage of zero in order to disable the automatic AOF
  1367. # rewrite feature.
  1368. auto-aof-rewrite-percentage 100
  1369. auto-aof-rewrite-min-size 64mb
  1370. # An AOF file may be found to be truncated at the end during the Redis
  1371. # startup process, when the AOF data gets loaded back into memory.
  1372. # This may happen when the system where Redis is running
  1373. # crashes, especially when an ext4 filesystem is mounted without the
  1374. # data=ordered option (however this can't happen when Redis itself
  1375. # crashes or aborts but the operating system still works correctly).
  1376. #
  1377. # Redis can either exit with an error when this happens, or load as much
  1378. # data as possible (the default now) and start if the AOF file is found
  1379. # to be truncated at the end. The following option controls this behavior.
  1380. #
  1381. # If aof-load-truncated is set to yes, a truncated AOF file is loaded and
  1382. # the Redis server starts emitting a log to inform the user of the event.
  1383. # Otherwise if the option is set to no, the server aborts with an error
  1384. # and refuses to start. When the option is set to no, the user requires
  1385. # to fix the AOF file using the "redis-check-aof" utility before to restart
  1386. # the server.
  1387. #
  1388. # Note that if the AOF file will be found to be corrupted in the middle
  1389. # the server will still exit with an error. This option only applies when
  1390. # Redis will try to read more data from the AOF file but not enough bytes
  1391. # will be found.
  1392. aof-load-truncated yes
  1393. # Redis can create append-only base files in either RDB or AOF formats. Using
  1394. # the RDB format is always faster and more efficient, and disabling it is only
  1395. # supported for backward compatibility purposes.
  1396. aof-use-rdb-preamble yes
  1397. # Redis supports recording timestamp annotations in the AOF to support restoring
  1398. # the data from a specific point-in-time. However, using this capability changes
  1399. # the AOF format in a way that may not be compatible with existing AOF parsers.
  1400. aof-timestamp-enabled no
  1401. ################################ SHUTDOWN #####################################
  1402. # Maximum time to wait for replicas when shutting down, in seconds.
  1403. #
  1404. # During shut down, a grace period allows any lagging replicas to catch up with
  1405. # the latest replication offset before the master exists. This period can
  1406. # prevent data loss, especially for deployments without configured disk backups.
  1407. #
  1408. # The 'shutdown-timeout' value is the grace period's duration in seconds. It is
  1409. # only applicable when the instance has replicas. To disable the feature, set
  1410. # the value to 0.
  1411. #
  1412. # shutdown-timeout 10
  1413. # When Redis receives a SIGINT or SIGTERM, shutdown is initiated and by default
  1414. # an RDB snapshot is written to disk in a blocking operation if save points are configured.
  1415. # The options used on signaled shutdown can include the following values:
  1416. # default: Saves RDB snapshot only if save points are configured.
  1417. # Waits for lagging replicas to catch up.
  1418. # save: Forces a DB saving operation even if no save points are configured.
  1419. # nosave: Prevents DB saving operation even if one or more save points are configured.
  1420. # now: Skips waiting for lagging replicas.
  1421. # force: Ignores any errors that would normally prevent the server from exiting.
  1422. #
  1423. # Any combination of values is allowed as long as "save" and "nosave" are not set simultaneously.
  1424. # Example: "nosave force now"
  1425. #
  1426. # shutdown-on-sigint default
  1427. # shutdown-on-sigterm default
  1428. ################ NON-DETERMINISTIC LONG BLOCKING COMMANDS #####################
  1429. # Maximum time in milliseconds for EVAL scripts, functions and in some cases
  1430. # modules' commands before Redis can start processing or rejecting other clients.
  1431. #
  1432. # If the maximum execution time is reached Redis will start to reply to most
  1433. # commands with a BUSY error.
  1434. #
  1435. # In this state Redis will only allow a handful of commands to be executed.
  1436. # For instance, SCRIPT KILL, FUNCTION KILL, SHUTDOWN NOSAVE and possibly some
  1437. # module specific 'allow-busy' commands.
  1438. #
  1439. # SCRIPT KILL and FUNCTION KILL will only be able to stop a script that did not
  1440. # yet call any write commands, so SHUTDOWN NOSAVE may be the only way to stop
  1441. # the server in the case a write command was already issued by the script when
  1442. # the user doesn't want to wait for the natural termination of the script.
  1443. #
  1444. # The default is 5 seconds. It is possible to set it to 0 or a negative value
  1445. # to disable this mechanism (uninterrupted execution). Note that in the past
  1446. # this config had a different name, which is now an alias, so both of these do
  1447. # the same:
  1448. # lua-time-limit 5000
  1449. # busy-reply-threshold 5000
  1450. ################################ REDIS CLUSTER ###############################
  1451. # Normal Redis instances can't be part of a Redis Cluster; only nodes that are
  1452. # started as cluster nodes can. In order to start a Redis instance as a
  1453. # cluster node enable the cluster support uncommenting the following:
  1454. #
  1455. # cluster-enabled yes
  1456. # Every cluster node has a cluster configuration file. This file is not
  1457. # intended to be edited by hand. It is created and updated by Redis nodes.
  1458. # Every Redis Cluster node requires a different cluster configuration file.
  1459. # Make sure that instances running in the same system do not have
  1460. # overlapping cluster configuration file names.
  1461. #
  1462. # cluster-config-file nodes-6379.conf
  1463. # Cluster node timeout is the amount of milliseconds a node must be unreachable
  1464. # for it to be considered in failure state.
  1465. # Most other internal time limits are a multiple of the node timeout.
  1466. #
  1467. # cluster-node-timeout 15000
  1468. # The cluster port is the port that the cluster bus will listen for inbound connections on. When set
  1469. # to the default value, 0, it will be bound to the command port + 10000. Setting this value requires
  1470. # you to specify the cluster bus port when executing cluster meet.
  1471. # cluster-port 0
  1472. # A replica of a failing master will avoid to start a failover if its data
  1473. # looks too old.
  1474. #
  1475. # There is no simple way for a replica to actually have an exact measure of
  1476. # its "data age", so the following two checks are performed:
  1477. #
  1478. # 1) If there are multiple replicas able to failover, they exchange messages
  1479. # in order to try to give an advantage to the replica with the best
  1480. # replication offset (more data from the master processed).
  1481. # Replicas will try to get their rank by offset, and apply to the start
  1482. # of the failover a delay proportional to their rank.
  1483. #
  1484. # 2) Every single replica computes the time of the last interaction with
  1485. # its master. This can be the last ping or command received (if the master
  1486. # is still in the "connected" state), or the time that elapsed since the
  1487. # disconnection with the master (if the replication link is currently down).
  1488. # If the last interaction is too old, the replica will not try to failover
  1489. # at all.
  1490. #
  1491. # The point "2" can be tuned by user. Specifically a replica will not perform
  1492. # the failover if, since the last interaction with the master, the time
  1493. # elapsed is greater than:
  1494. #
  1495. # (node-timeout * cluster-replica-validity-factor) + repl-ping-replica-period
  1496. #
  1497. # So for example if node-timeout is 30 seconds, and the cluster-replica-validity-factor
  1498. # is 10, and assuming a default repl-ping-replica-period of 10 seconds, the
  1499. # replica will not try to failover if it was not able to talk with the master
  1500. # for longer than 310 seconds.
  1501. #
  1502. # A large cluster-replica-validity-factor may allow replicas with too old data to failover
  1503. # a master, while a too small value may prevent the cluster from being able to
  1504. # elect a replica at all.
  1505. #
  1506. # For maximum availability, it is possible to set the cluster-replica-validity-factor
  1507. # to a value of 0, which means, that replicas will always try to failover the
  1508. # master regardless of the last time they interacted with the master.
  1509. # (However they'll always try to apply a delay proportional to their
  1510. # offset rank).
  1511. #
  1512. # Zero is the only value able to guarantee that when all the partitions heal
  1513. # the cluster will always be able to continue.
  1514. #
  1515. # cluster-replica-validity-factor 10
  1516. # Cluster replicas are able to migrate to orphaned masters, that are masters
  1517. # that are left without working replicas. This improves the cluster ability
  1518. # to resist to failures as otherwise an orphaned master can't be failed over
  1519. # in case of failure if it has no working replicas.
  1520. #
  1521. # Replicas migrate to orphaned masters only if there are still at least a
  1522. # given number of other working replicas for their old master. This number
  1523. # is the "migration barrier". A migration barrier of 1 means that a replica
  1524. # will migrate only if there is at least 1 other working replica for its master
  1525. # and so forth. It usually reflects the number of replicas you want for every
  1526. # master in your cluster.
  1527. #
  1528. # Default is 1 (replicas migrate only if their masters remain with at least
  1529. # one replica). To disable migration just set it to a very large value or
  1530. # set cluster-allow-replica-migration to 'no'.
  1531. # A value of 0 can be set but is useful only for debugging and dangerous
  1532. # in production.
  1533. #
  1534. # cluster-migration-barrier 1
  1535. # Turning off this option allows to use less automatic cluster configuration.
  1536. # It both disables migration to orphaned masters and migration from masters
  1537. # that became empty.
  1538. #
  1539. # Default is 'yes' (allow automatic migrations).
  1540. #
  1541. # cluster-allow-replica-migration yes
  1542. # By default Redis Cluster nodes stop accepting queries if they detect there
  1543. # is at least a hash slot uncovered (no available node is serving it).
  1544. # This way if the cluster is partially down (for example a range of hash slots
  1545. # are no longer covered) all the cluster becomes, eventually, unavailable.
  1546. # It automatically returns available as soon as all the slots are covered again.
  1547. #
  1548. # However sometimes you want the subset of the cluster which is working,
  1549. # to continue to accept queries for the part of the key space that is still
  1550. # covered. In order to do so, just set the cluster-require-full-coverage
  1551. # option to no.
  1552. #
  1553. # cluster-require-full-coverage yes
  1554. # This option, when set to yes, prevents replicas from trying to failover its
  1555. # master during master failures. However the replica can still perform a
  1556. # manual failover, if forced to do so.
  1557. #
  1558. # This is useful in different scenarios, especially in the case of multiple
  1559. # data center operations, where we want one side to never be promoted if not
  1560. # in the case of a total DC failure.
  1561. #
  1562. # cluster-replica-no-failover no
  1563. # This option, when set to yes, allows nodes to serve read traffic while the
  1564. # cluster is in a down state, as long as it believes it owns the slots.
  1565. #
  1566. # This is useful for two cases. The first case is for when an application
  1567. # doesn't require consistency of data during node failures or network partitions.
  1568. # One example of this is a cache, where as long as the node has the data it
  1569. # should be able to serve it.
  1570. #
  1571. # The second use case is for configurations that don't meet the recommended
  1572. # three shards but want to enable cluster mode and scale later. A
  1573. # master outage in a 1 or 2 shard configuration causes a read/write outage to the
  1574. # entire cluster without this option set, with it set there is only a write outage.
  1575. # Without a quorum of masters, slot ownership will not change automatically.
  1576. #
  1577. # cluster-allow-reads-when-down no
  1578. # This option, when set to yes, allows nodes to serve pubsub shard traffic while
  1579. # the cluster is in a down state, as long as it believes it owns the slots.
  1580. #
  1581. # This is useful if the application would like to use the pubsub feature even when
  1582. # the cluster global stable state is not OK. If the application wants to make sure only
  1583. # one shard is serving a given channel, this feature should be kept as yes.
  1584. #
  1585. # cluster-allow-pubsubshard-when-down yes
  1586. # Cluster link send buffer limit is the limit on the memory usage of an individual
  1587. # cluster bus link's send buffer in bytes. Cluster links would be freed if they exceed
  1588. # this limit. This is to primarily prevent send buffers from growing unbounded on links
  1589. # toward slow peers (E.g. PubSub messages being piled up).
  1590. # This limit is disabled by default. Enable this limit when 'mem_cluster_links' INFO field
  1591. # and/or 'send-buffer-allocated' entries in the 'CLUSTER LINKS` command output continuously increase.
  1592. # Minimum limit of 1gb is recommended so that cluster link buffer can fit in at least a single
  1593. # PubSub message by default. (client-query-buffer-limit default value is 1gb)
  1594. #
  1595. # cluster-link-sendbuf-limit 0
  1596. # Clusters can configure their announced hostname using this config. This is a common use case for
  1597. # applications that need to use TLS Server Name Indication (SNI) or dealing with DNS based
  1598. # routing. By default this value is only shown as additional metadata in the CLUSTER SLOTS
  1599. # command, but can be changed using 'cluster-preferred-endpoint-type' config. This value is
  1600. # communicated along the clusterbus to all nodes, setting it to an empty string will remove
  1601. # the hostname and also propagate the removal.
  1602. #
  1603. # cluster-announce-hostname ""
  1604. # Clusters can configure an optional nodename to be used in addition to the node ID for
  1605. # debugging and admin information. This name is broadcasted between nodes, so will be used
  1606. # in addition to the node ID when reporting cross node events such as node failures.
  1607. # cluster-announce-human-nodename ""
  1608. # Clusters can advertise how clients should connect to them using either their IP address,
  1609. # a user defined hostname, or by declaring they have no endpoint. Which endpoint is
  1610. # shown as the preferred endpoint is set by using the cluster-preferred-endpoint-type
  1611. # config with values 'ip', 'hostname', or 'unknown-endpoint'. This value controls how
  1612. # the endpoint returned for MOVED/ASKING requests as well as the first field of CLUSTER SLOTS.
  1613. # If the preferred endpoint type is set to hostname, but no announced hostname is set, a '?'
  1614. # will be returned instead.
  1615. #
  1616. # When a cluster advertises itself as having an unknown endpoint, it's indicating that
  1617. # the server doesn't know how clients can reach the cluster. This can happen in certain
  1618. # networking situations where there are multiple possible routes to the node, and the
  1619. # server doesn't know which one the client took. In this case, the server is expecting
  1620. # the client to reach out on the same endpoint it used for making the last request, but use
  1621. # the port provided in the response.
  1622. #
  1623. # cluster-preferred-endpoint-type ip
  1624. # In order to setup your cluster make sure to read the documentation
  1625. # available at https://redis.io web site.
  1626. ########################## CLUSTER DOCKER/NAT support ########################
  1627. # In certain deployments, Redis Cluster nodes address discovery fails, because
  1628. # addresses are NAT-ted or because ports are forwarded (the typical case is
  1629. # Docker and other containers).
  1630. #
  1631. # In order to make Redis Cluster working in such environments, a static
  1632. # configuration where each node knows its public address is needed. The
  1633. # following four options are used for this scope, and are:
  1634. #
  1635. # * cluster-announce-ip
  1636. # * cluster-announce-port
  1637. # * cluster-announce-tls-port
  1638. # * cluster-announce-bus-port
  1639. #
  1640. # Each instructs the node about its address, client ports (for connections
  1641. # without and with TLS) and cluster message bus port. The information is then
  1642. # published in the header of the bus packets so that other nodes will be able to
  1643. # correctly map the address of the node publishing the information.
  1644. #
  1645. # If tls-cluster is set to yes and cluster-announce-tls-port is omitted or set
  1646. # to zero, then cluster-announce-port refers to the TLS port. Note also that
  1647. # cluster-announce-tls-port has no effect if tls-cluster is set to no.
  1648. #
  1649. # If the above options are not used, the normal Redis Cluster auto-detection
  1650. # will be used instead.
  1651. #
  1652. # Note that when remapped, the bus port may not be at the fixed offset of
  1653. # clients port + 10000, so you can specify any port and bus-port depending
  1654. # on how they get remapped. If the bus-port is not set, a fixed offset of
  1655. # 10000 will be used as usual.
  1656. #
  1657. # Example:
  1658. #
  1659. # cluster-announce-ip 10.1.1.5
  1660. # cluster-announce-tls-port 6379
  1661. # cluster-announce-port 0
  1662. # cluster-announce-bus-port 6380
  1663. ################################## SLOW LOG ###################################
  1664. # The Redis Slow Log is a system to log queries that exceeded a specified
  1665. # execution time. The execution time does not include the I/O operations
  1666. # like talking with the client, sending the reply and so forth,
  1667. # but just the time needed to actually execute the command (this is the only
  1668. # stage of command execution where the thread is blocked and can not serve
  1669. # other requests in the meantime).
  1670. #
  1671. # You can configure the slow log with two parameters: one tells Redis
  1672. # what is the execution time, in microseconds, to exceed in order for the
  1673. # command to get logged, and the other parameter is the length of the
  1674. # slow log. When a new command is logged the oldest one is removed from the
  1675. # queue of logged commands.
  1676. # The following time is expressed in microseconds, so 1000000 is equivalent
  1677. # to one second. Note that a negative number disables the slow log, while
  1678. # a value of zero forces the logging of every command.
  1679. slowlog-log-slower-than 10000
  1680. # There is no limit to this length. Just be aware that it will consume memory.
  1681. # You can reclaim memory used by the slow log with SLOWLOG RESET.
  1682. slowlog-max-len 128
  1683. ################################ LATENCY MONITOR ##############################
  1684. # The Redis latency monitoring subsystem samples different operations
  1685. # at runtime in order to collect data related to possible sources of
  1686. # latency of a Redis instance.
  1687. #
  1688. # Via the LATENCY command this information is available to the user that can
  1689. # print graphs and obtain reports.
  1690. #
  1691. # The system only logs operations that were performed in a time equal or
  1692. # greater than the amount of milliseconds specified via the
  1693. # latency-monitor-threshold configuration directive. When its value is set
  1694. # to zero, the latency monitor is turned off.
  1695. #
  1696. # By default latency monitoring is disabled since it is mostly not needed
  1697. # if you don't have latency issues, and collecting data has a performance
  1698. # impact, that while very small, can be measured under big load. Latency
  1699. # monitoring can easily be enabled at runtime using the command
  1700. # "CONFIG SET latency-monitor-threshold <milliseconds>" if needed.
  1701. latency-monitor-threshold 0
  1702. ################################ LATENCY TRACKING ##############################
  1703. # The Redis extended latency monitoring tracks the per command latencies and enables
  1704. # exporting the percentile distribution via the INFO latencystats command,
  1705. # and cumulative latency distributions (histograms) via the LATENCY command.
  1706. #
  1707. # By default, the extended latency monitoring is enabled since the overhead
  1708. # of keeping track of the command latency is very small.
  1709. # latency-tracking yes
  1710. # By default the exported latency percentiles via the INFO latencystats command
  1711. # are the p50, p99, and p999.
  1712. # latency-tracking-info-percentiles 50 99 99.9
  1713. ############################# EVENT NOTIFICATION ##############################
  1714. # Redis can notify Pub/Sub clients about events happening in the key space.
  1715. # This feature is documented at https://redis.io/topics/notifications
  1716. #
  1717. # For instance if keyspace events notification is enabled, and a client
  1718. # performs a DEL operation on key "foo" stored in the Database 0, two
  1719. # messages will be published via Pub/Sub:
  1720. #
  1721. # PUBLISH __keyspace@0__:foo del
  1722. # PUBLISH __keyevent@0__:del foo
  1723. #
  1724. # It is possible to select the events that Redis will notify among a set
  1725. # of classes. Every class is identified by a single character:
  1726. #
  1727. # K Keyspace events, published with __keyspace@<db>__ prefix.
  1728. # E Keyevent events, published with __keyevent@<db>__ prefix.
  1729. # g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
  1730. # $ String commands
  1731. # l List commands
  1732. # s Set commands
  1733. # h Hash commands
  1734. # z Sorted set commands
  1735. # x Expired events (events generated every time a key expires)
  1736. # e Evicted events (events generated when a key is evicted for maxmemory)
  1737. # n New key events (Note: not included in the 'A' class)
  1738. # t Stream commands
  1739. # d Module key type events
  1740. # m Key-miss events (Note: It is not included in the 'A' class)
  1741. # A Alias for g$lshzxetd, so that the "AKE" string means all the events
  1742. # (Except key-miss events which are excluded from 'A' due to their
  1743. # unique nature).
  1744. #
  1745. # The "notify-keyspace-events" takes as argument a string that is composed
  1746. # of zero or multiple characters. The empty string means that notifications
  1747. # are disabled.
  1748. #
  1749. # Example: to enable list and generic events, from the point of view of the
  1750. # event name, use:
  1751. #
  1752. # notify-keyspace-events Elg
  1753. #
  1754. # Example 2: to get the stream of the expired keys subscribing to channel
  1755. # name __keyevent@0__:expired use:
  1756. #
  1757. # notify-keyspace-events Ex
  1758. #
  1759. # By default all notifications are disabled because most users don't need
  1760. # this feature and the feature has some overhead. Note that if you don't
  1761. # specify at least one of K or E, no events will be delivered.
  1762. notify-keyspace-events Exg
  1763. ############################### ADVANCED CONFIG ###############################
  1764. # Hashes are encoded using a memory efficient data structure when they have a
  1765. # small number of entries, and the biggest entry does not exceed a given
  1766. # threshold. These thresholds can be configured using the following directives.
  1767. hash-max-listpack-entries 512
  1768. hash-max-listpack-value 64
  1769. # Lists are also encoded in a special way to save a lot of space.
  1770. # The number of entries allowed per internal list node can be specified
  1771. # as a fixed maximum size or a maximum number of elements.
  1772. # For a fixed maximum size, use -5 through -1, meaning:
  1773. # -5: max size: 64 Kb <-- not recommended for normal workloads
  1774. # -4: max size: 32 Kb <-- not recommended
  1775. # -3: max size: 16 Kb <-- probably not recommended
  1776. # -2: max size: 8 Kb <-- good
  1777. # -1: max size: 4 Kb <-- good
  1778. # Positive numbers mean store up to _exactly_ that number of elements
  1779. # per list node.
  1780. # The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size),
  1781. # but if your use case is unique, adjust the settings as necessary.
  1782. list-max-listpack-size -2
  1783. # Lists may also be compressed.
  1784. # Compress depth is the number of quicklist ziplist nodes from *each* side of
  1785. # the list to *exclude* from compression. The head and tail of the list
  1786. # are always uncompressed for fast push/pop operations. Settings are:
  1787. # 0: disable all list compression
  1788. # 1: depth 1 means "don't start compressing until after 1 node into the list,
  1789. # going from either the head or tail"
  1790. # So: [head]->node->node->...->node->[tail]
  1791. # [head], [tail] will always be uncompressed; inner nodes will compress.
  1792. # 2: [head]->[next]->node->node->...->node->[prev]->[tail]
  1793. # 2 here means: don't compress head or head->next or tail->prev or tail,
  1794. # but compress all nodes between them.
  1795. # 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail]
  1796. # etc.
  1797. list-compress-depth 0
  1798. # Sets have a special encoding when a set is composed
  1799. # of just strings that happen to be integers in radix 10 in the range
  1800. # of 64 bit signed integers.
  1801. # The following configuration setting sets the limit in the size of the
  1802. # set in order to use this special memory saving encoding.
  1803. set-max-intset-entries 512
  1804. # Sets containing non-integer values are also encoded using a memory efficient
  1805. # data structure when they have a small number of entries, and the biggest entry
  1806. # does not exceed a given threshold. These thresholds can be configured using
  1807. # the following directives.
  1808. set-max-listpack-entries 128
  1809. set-max-listpack-value 64
  1810. # Similarly to hashes and lists, sorted sets are also specially encoded in
  1811. # order to save a lot of space. This encoding is only used when the length and
  1812. # elements of a sorted set are below the following limits:
  1813. zset-max-listpack-entries 128
  1814. zset-max-listpack-value 64
  1815. # HyperLogLog sparse representation bytes limit. The limit includes the
  1816. # 16 bytes header. When a HyperLogLog using the sparse representation crosses
  1817. # this limit, it is converted into the dense representation.
  1818. #
  1819. # A value greater than 16000 is totally useless, since at that point the
  1820. # dense representation is more memory efficient.
  1821. #
  1822. # The suggested value is ~ 3000 in order to have the benefits of
  1823. # the space efficient encoding without slowing down too much PFADD,
  1824. # which is O(N) with the sparse encoding. The value can be raised to
  1825. # ~ 10000 when CPU is not a concern, but space is, and the data set is
  1826. # composed of many HyperLogLogs with cardinality in the 0 - 15000 range.
  1827. hll-sparse-max-bytes 3000
  1828. # Streams macro node max size / items. The stream data structure is a radix
  1829. # tree of big nodes that encode multiple items inside. Using this configuration
  1830. # it is possible to configure how big a single node can be in bytes, and the
  1831. # maximum number of items it may contain before switching to a new node when
  1832. # appending new stream entries. If any of the following settings are set to
  1833. # zero, the limit is ignored, so for instance it is possible to set just a
  1834. # max entries limit by setting max-bytes to 0 and max-entries to the desired
  1835. # value.
  1836. stream-node-max-bytes 4096
  1837. stream-node-max-entries 100
  1838. # Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
  1839. # order to help rehashing the main Redis hash table (the one mapping top-level
  1840. # keys to values). The hash table implementation Redis uses (see dict.c)
  1841. # performs a lazy rehashing: the more operation you run into a hash table
  1842. # that is rehashing, the more rehashing "steps" are performed, so if the
  1843. # server is idle the rehashing is never complete and some more memory is used
  1844. # by the hash table.
  1845. #
  1846. # The default is to use this millisecond 10 times every second in order to
  1847. # actively rehash the main dictionaries, freeing memory when possible.
  1848. #
  1849. # If unsure:
  1850. # use "activerehashing no" if you have hard latency requirements and it is
  1851. # not a good thing in your environment that Redis can reply from time to time
  1852. # to queries with 2 milliseconds delay.
  1853. #
  1854. # use "activerehashing yes" if you don't have such hard requirements but
  1855. # want to free memory asap when possible.
  1856. activerehashing yes
  1857. # The client output buffer limits can be used to force disconnection of clients
  1858. # that are not reading data from the server fast enough for some reason (a
  1859. # common reason is that a Pub/Sub client can't consume messages as fast as the
  1860. # publisher can produce them).
  1861. #
  1862. # The limit can be set differently for the three different classes of clients:
  1863. #
  1864. # normal -> normal clients including MONITOR clients
  1865. # replica -> replica clients
  1866. # pubsub -> clients subscribed to at least one pubsub channel or pattern
  1867. #
  1868. # The syntax of every client-output-buffer-limit directive is the following:
  1869. #
  1870. # client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
  1871. #
  1872. # A client is immediately disconnected once the hard limit is reached, or if
  1873. # the soft limit is reached and remains reached for the specified number of
  1874. # seconds (continuously).
  1875. # So for instance if the hard limit is 32 megabytes and the soft limit is
  1876. # 16 megabytes / 10 seconds, the client will get disconnected immediately
  1877. # if the size of the output buffers reach 32 megabytes, but will also get
  1878. # disconnected if the client reaches 16 megabytes and continuously overcomes
  1879. # the limit for 10 seconds.
  1880. #
  1881. # By default normal clients are not limited because they don't receive data
  1882. # without asking (in a push way), but just after a request, so only
  1883. # asynchronous clients may create a scenario where data is requested faster
  1884. # than it can read.
  1885. #
  1886. # Instead there is a default limit for pubsub and replica clients, since
  1887. # subscribers and replicas receive data in a push fashion.
  1888. #
  1889. # Note that it doesn't make sense to set the replica clients output buffer
  1890. # limit lower than the repl-backlog-size config (partial sync will succeed
  1891. # and then replica will get disconnected).
  1892. # Such a configuration is ignored (the size of repl-backlog-size will be used).
  1893. # This doesn't have memory consumption implications since the replica client
  1894. # will share the backlog buffers memory.
  1895. #
  1896. # Both the hard or the soft limit can be disabled by setting them to zero.
  1897. client-output-buffer-limit normal 0 0 0
  1898. client-output-buffer-limit replica 256mb 64mb 60
  1899. client-output-buffer-limit pubsub 32mb 8mb 60
  1900. # Client query buffers accumulate new commands. They are limited to a fixed
  1901. # amount by default in order to avoid that a protocol desynchronization (for
  1902. # instance due to a bug in the client) will lead to unbound memory usage in
  1903. # the query buffer. However you can configure it here if you have very special
  1904. # needs, such as a command with huge argument, or huge multi/exec requests or alike.
  1905. #
  1906. # client-query-buffer-limit 1gb
  1907. # In some scenarios client connections can hog up memory leading to OOM
  1908. # errors or data eviction. To avoid this we can cap the accumulated memory
  1909. # used by all client connections (all pubsub and normal clients). Once we
  1910. # reach that limit connections will be dropped by the server freeing up
  1911. # memory. The server will attempt to drop the connections using the most
  1912. # memory first. We call this mechanism "client eviction".
  1913. #
  1914. # Client eviction is configured using the maxmemory-clients setting as follows:
  1915. # 0 - client eviction is disabled (default)
  1916. #
  1917. # A memory value can be used for the client eviction threshold,
  1918. # for example:
  1919. # maxmemory-clients 1g
  1920. #
  1921. # A percentage value (between 1% and 100%) means the client eviction threshold
  1922. # is based on a percentage of the maxmemory setting. For example to set client
  1923. # eviction at 5% of maxmemory:
  1924. # maxmemory-clients 5%
  1925. # In the Redis protocol, bulk requests, that are, elements representing single
  1926. # strings, are normally limited to 512 mb. However you can change this limit
  1927. # here, but must be 1mb or greater
  1928. #
  1929. # proto-max-bulk-len 512mb
  1930. # Redis calls an internal function to perform many background tasks, like
  1931. # closing connections of clients in timeout, purging expired keys that are
  1932. # never requested, and so forth.
  1933. #
  1934. # Not all tasks are performed with the same frequency, but Redis checks for
  1935. # tasks to perform according to the specified "hz" value.
  1936. #
  1937. # By default "hz" is set to 10. Raising the value will use more CPU when
  1938. # Redis is idle, but at the same time will make Redis more responsive when
  1939. # there are many keys expiring at the same time, and timeouts may be
  1940. # handled with more precision.
  1941. #
  1942. # The range is between 1 and 500, however a value over 100 is usually not
  1943. # a good idea. Most users should use the default of 10 and raise this up to
  1944. # 100 only in environments where very low latency is required.
  1945. hz 10
  1946. # Normally it is useful to have an HZ value which is proportional to the
  1947. # number of clients connected. This is useful in order, for instance, to
  1948. # avoid too many clients are processed for each background task invocation
  1949. # in order to avoid latency spikes.
  1950. #
  1951. # Since the default HZ value by default is conservatively set to 10, Redis
  1952. # offers, and enables by default, the ability to use an adaptive HZ value
  1953. # which will temporarily raise when there are many connected clients.
  1954. #
  1955. # When dynamic HZ is enabled, the actual configured HZ will be used
  1956. # as a baseline, but multiples of the configured HZ value will be actually
  1957. # used as needed once more clients are connected. In this way an idle
  1958. # instance will use very little CPU time while a busy instance will be
  1959. # more responsive.
  1960. dynamic-hz yes
  1961. # When a child rewrites the AOF file, if the following option is enabled
  1962. # the file will be fsync-ed every 4 MB of data generated. This is useful
  1963. # in order to commit the file to the disk more incrementally and avoid
  1964. # big latency spikes.
  1965. aof-rewrite-incremental-fsync yes
  1966. # When redis saves RDB file, if the following option is enabled
  1967. # the file will be fsync-ed every 4 MB of data generated. This is useful
  1968. # in order to commit the file to the disk more incrementally and avoid
  1969. # big latency spikes.
  1970. rdb-save-incremental-fsync yes
  1971. # Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good
  1972. # idea to start with the default settings and only change them after investigating
  1973. # how to improve the performances and how the keys LFU change over time, which
  1974. # is possible to inspect via the OBJECT FREQ command.
  1975. #
  1976. # There are two tunable parameters in the Redis LFU implementation: the
  1977. # counter logarithm factor and the counter decay time. It is important to
  1978. # understand what the two parameters mean before changing them.
  1979. #
  1980. # The LFU counter is just 8 bits per key, it's maximum value is 255, so Redis
  1981. # uses a probabilistic increment with logarithmic behavior. Given the value
  1982. # of the old counter, when a key is accessed, the counter is incremented in
  1983. # this way:
  1984. #
  1985. # 1. A random number R between 0 and 1 is extracted.
  1986. # 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1).
  1987. # 3. The counter is incremented only if R < P.
  1988. #
  1989. # The default lfu-log-factor is 10. This is a table of how the frequency
  1990. # counter changes with a different number of accesses with different
  1991. # logarithmic factors:
  1992. #
  1993. # +--------+------------+------------+------------+------------+------------+
  1994. # | factor | 100 hits | 1000 hits | 100K hits | 1M hits | 10M hits |
  1995. # +--------+------------+------------+------------+------------+------------+
  1996. # | 0 | 104 | 255 | 255 | 255 | 255 |
  1997. # +--------+------------+------------+------------+------------+------------+
  1998. # | 1 | 18 | 49 | 255 | 255 | 255 |
  1999. # +--------+------------+------------+------------+------------+------------+
  2000. # | 10 | 10 | 18 | 142 | 255 | 255 |
  2001. # +--------+------------+------------+------------+------------+------------+
  2002. # | 100 | 8 | 11 | 49 | 143 | 255 |
  2003. # +--------+------------+------------+------------+------------+------------+
  2004. #
  2005. # NOTE: The above table was obtained by running the following commands:
  2006. #
  2007. # redis-benchmark -n 1000000 incr foo
  2008. # redis-cli object freq foo
  2009. #
  2010. # NOTE 2: The counter initial value is 5 in order to give new objects a chance
  2011. # to accumulate hits.
  2012. #
  2013. # The counter decay time is the time, in minutes, that must elapse in order
  2014. # for the key counter to be decremented.
  2015. #
  2016. # The default value for the lfu-decay-time is 1. A special value of 0 means we
  2017. # will never decay the counter.
  2018. #
  2019. # lfu-log-factor 10
  2020. # lfu-decay-time 1
  2021. # The maximum number of new client connections accepted per event-loop cycle. This configuration
  2022. # is set independently for TLS connections.
  2023. #
  2024. # By default, up to 10 new connection will be accepted per event-loop cycle for normal connections
  2025. # and up to 1 new connection per event-loop cycle for TLS connections.
  2026. #
  2027. # Adjusting this to a larger number can slightly improve efficiency for new connections
  2028. # at the risk of causing timeouts for regular commands on established connections. It is
  2029. # not advised to change this without ensuring that all clients have limited connection
  2030. # pools and exponential backoff in the case of command/connection timeouts.
  2031. #
  2032. # If your application is establishing a large number of new connections per second you should
  2033. # also consider tuning the value of tcp-backlog, which allows the kernel to buffer more
  2034. # pending connections before dropping or rejecting connections.
  2035. #
  2036. # max-new-connections-per-cycle 10
  2037. # max-new-tls-connections-per-cycle 1
  2038. ########################### ACTIVE DEFRAGMENTATION #######################
  2039. #
  2040. # What is active defragmentation?
  2041. # -------------------------------
  2042. #
  2043. # Active (online) defragmentation allows a Redis server to compact the
  2044. # spaces left between small allocations and deallocations of data in memory,
  2045. # thus allowing to reclaim back memory.
  2046. #
  2047. # Fragmentation is a natural process that happens with every allocator (but
  2048. # less so with Jemalloc, fortunately) and certain workloads. Normally a server
  2049. # restart is needed in order to lower the fragmentation, or at least to flush
  2050. # away all the data and create it again. However thanks to this feature
  2051. # implemented by Oran Agra for Redis 4.0 this process can happen at runtime
  2052. # in a "hot" way, while the server is running.
  2053. #
  2054. # Basically when the fragmentation is over a certain level (see the
  2055. # configuration options below) Redis will start to create new copies of the
  2056. # values in contiguous memory regions by exploiting certain specific Jemalloc
  2057. # features (in order to understand if an allocation is causing fragmentation
  2058. # and to allocate it in a better place), and at the same time, will release the
  2059. # old copies of the data. This process, repeated incrementally for all the keys
  2060. # will cause the fragmentation to drop back to normal values.
  2061. #
  2062. # Important things to understand:
  2063. #
  2064. # 1. This feature is disabled by default, and only works if you compiled Redis
  2065. # to use the copy of Jemalloc we ship with the source code of Redis.
  2066. # This is the default with Linux builds.
  2067. #
  2068. # 2. You never need to enable this feature if you don't have fragmentation
  2069. # issues.
  2070. #
  2071. # 3. Once you experience fragmentation, you can enable this feature when
  2072. # needed with the command "CONFIG SET activedefrag yes".
  2073. #
  2074. # The configuration parameters are able to fine tune the behavior of the
  2075. # defragmentation process. If you are not sure about what they mean it is
  2076. # a good idea to leave the defaults untouched.
  2077. # Active defragmentation is disabled by default
  2078. # activedefrag no
  2079. # Minimum amount of fragmentation waste to start active defrag
  2080. # active-defrag-ignore-bytes 100mb
  2081. # Minimum percentage of fragmentation to start active defrag
  2082. # active-defrag-threshold-lower 10
  2083. # Maximum percentage of fragmentation at which we use maximum effort
  2084. # active-defrag-threshold-upper 100
  2085. # Minimal effort for defrag in CPU percentage, to be used when the lower
  2086. # threshold is reached
  2087. # active-defrag-cycle-min 1
  2088. # Maximal effort for defrag in CPU percentage, to be used when the upper
  2089. # threshold is reached
  2090. # active-defrag-cycle-max 25
  2091. # Maximum number of set/hash/zset/list fields that will be processed from
  2092. # the main dictionary scan
  2093. # active-defrag-max-scan-fields 1000
  2094. # Jemalloc background thread for purging will be enabled by default
  2095. jemalloc-bg-thread yes
  2096. # It is possible to pin different threads and processes of Redis to specific
  2097. # CPUs in your system, in order to maximize the performances of the server.
  2098. # This is useful both in order to pin different Redis threads in different
  2099. # CPUs, but also in order to make sure that multiple Redis instances running
  2100. # in the same host will be pinned to different CPUs.
  2101. #
  2102. # Normally you can do this using the "taskset" command, however it is also
  2103. # possible to this via Redis configuration directly, both in Linux and FreeBSD.
  2104. #
  2105. # You can pin the server/IO threads, bio threads, aof rewrite child process, and
  2106. # the bgsave child process. The syntax to specify the cpu list is the same as
  2107. # the taskset command:
  2108. #
  2109. # Set redis server/io threads to cpu affinity 0,2,4,6:
  2110. # server-cpulist 0-7:2
  2111. #
  2112. # Set bio threads to cpu affinity 1,3:
  2113. # bio-cpulist 1,3
  2114. #
  2115. # Set aof rewrite child process to cpu affinity 8,9,10,11:
  2116. # aof-rewrite-cpulist 8-11
  2117. #
  2118. # Set bgsave child process to cpu affinity 1,10,11
  2119. # bgsave-cpulist 1,10-11
  2120. # In some cases redis will emit warnings and even refuse to start if it detects
  2121. # that the system is in bad state, it is possible to suppress these warnings
  2122. # by setting the following config which takes a space delimited list of warnings
  2123. # to suppress
  2124. #
  2125. # ignore-warnings ARM64-COW-BUG