xref: /freebsd/contrib/unbound/testdata/redis_reconnect_interval.tdir/redis.conf (revision b2efd602aea8b3cbc3fb215b9611946d04fceb10)
1###
2###  Settings for this test ###################################################
3###
4
5# Accept connections on the specified port, default is 6379 (IANA #815344).
6# If port 0 is specified Redis will not listen on a TCP socket.
7port 0
8
9# Unix socket.
10#
11# Specify the path for the Unix socket that will be used to listen for
12# incoming connections. There is no default, so Redis will not listen
13# on a unix socket when not specified.
14#
15unixsocket @SOCKET@
16# unixsocketperm 700
17
18# By default Redis does not run as a daemon. Use 'yes' if you need it.
19# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
20# When Redis is supervised by upstart or systemd, this parameter has no impact.
21daemonize no
22
23# Specify the server verbosity level.
24# This can be one of:
25# debug (a lot of information, useful for development/testing)
26# verbose (many rarely useful info, but not a mess like the debug level)
27# notice (moderately verbose, what you want in production probably)
28# warning (only very important / critical messages are logged)
29# nothing (nothing is logged)
30loglevel notice
31
32# Specify the log file name. Also the empty string can be used to force
33# Redis to log on the standard output. Note that if you use standard
34# output for logging but daemonize, logs will be sent to /dev/null
35logfile @LOGFILE@
36
37# To enable logging to the system logger, just set 'syslog-enabled' to yes,
38# and optionally update the other syslog parameters to suit your needs.
39syslog-enabled no
40
41# Set the number of databases. The default database is DB 0, you can select
42# a different one on a per-connection basis using SELECT <dbid> where
43# dbid is a number between 0 and 'databases'-1
44databases 2
45
46# Snapshotting can be completely disabled with a single empty string argument
47# as in following example:
48#
49save ""
50
51# The working directory.
52#
53# The DB will be written inside this directory, with the filename specified
54# above using the 'dbfilename' configuration directive.
55#
56# The Append Only File will also be created inside this directory.
57#
58# Note that you must specify a directory here, not a file name.
59dir .
60
61###
62###  Rest of the default Redis settings #######################################
63###
64
65bind 127.0.0.1 -::1
66
67# When protected mode is on and the default user has no password, the server
68# only accepts local connections from the IPv4 address (127.0.0.1), IPv6 address
69# (::1) or Unix domain sockets.
70protected-mode yes
71
72# TCP listen() backlog.
73#
74# In high requests-per-second environments you need a high backlog in order
75# to avoid slow clients connection issues. Note that the Linux kernel
76# will silently truncate it to the value of /proc/sys/net/core/somaxconn so
77# make sure to raise both the value of somaxconn and tcp_max_syn_backlog
78# in order to get the desired effect.
79tcp-backlog 511
80
81# Close the connection after a client is idle for N seconds (0 to disable)
82timeout 0
83
84# TCP keepalive.
85# A reasonable value for this option is 300 seconds, which is the new
86# Redis default starting with Redis 3.2.1.
87tcp-keepalive 300
88
89# By default Redis shows an ASCII art logo only when started to log to the
90# standard output and if the standard output is a TTY and syslog logging is
91# disabled. Basically this means that normally a logo is displayed only in
92# interactive sessions.
93#
94# However it is possible to force the pre-4.0 behavior and always show a
95# ASCII art logo in startup logs by setting the following option to yes.
96always-show-logo no
97
98# By default, Redis modifies the process title (as seen in 'top' and 'ps') to
99# provide some runtime information. It is possible to disable this and leave
100# the process name as executed by setting the following to no.
101set-proc-title yes
102
103# When changing the process title, Redis uses the following template to construct
104# the modified title.
105#
106# Template variables are specified in curly brackets. The following variables are
107# supported:
108#
109# {title}           Name of process as executed if parent, or type of child process.
110# {listen-addr}     Bind address or '*' followed by TCP or TLS port listening on, or
111#                   Unix socket if only that's available.
112# {server-mode}     Special mode, i.e. "[sentinel]" or "[cluster]".
113# {port}            TCP port listening on, or 0.
114# {tls-port}        TLS port listening on, or 0.
115# {unixsocket}      Unix domain socket listening on, or "".
116# {config-file}     Name of configuration file used.
117#
118proc-title-template "{title} {listen-addr} {server-mode}"
119
120# Set the local environment which is used for string comparison operations, and
121# also affect the performance of Lua scripts. Empty String indicates the locale
122# is derived from the environment variables.
123#locale-collate ""
124
125# By default Redis will stop accepting writes if RDB snapshots are enabled
126# (at least one save point) and the latest background save failed.
127# This will make the user aware (in a hard way) that data is not persisting
128# on disk properly, otherwise chances are that no one will notice and some
129# disaster will happen.
130#
131# If the background saving process will start working again Redis will
132# automatically allow writes again.
133#
134# However if you have setup your proper monitoring of the Redis server
135# and persistence, you may want to disable this feature so that Redis will
136# continue to work as usual even if there are problems with disk,
137# permissions, and so forth.
138stop-writes-on-bgsave-error yes
139
140# Compress string objects using LZF when dump .rdb databases?
141# By default compression is enabled as it's almost always a win.
142# If you want to save some CPU in the saving child set it to 'no' but
143# the dataset will likely be bigger if you have compressible values or keys.
144rdbcompression yes
145
146# Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
147# This makes the format more resistant to corruption but there is a performance
148# hit to pay (around 10%) when saving and loading RDB files, so you can disable it
149# for maximum performances.
150#
151# RDB files created with checksum disabled have a checksum of zero that will
152# tell the loading code to skip the check.
153rdbchecksum yes
154
155# The filename where to dump the DB
156dbfilename redis.rdb
157
158# Remove RDB files used by replication in instances without persistence
159# enabled. By default this option is disabled, however there are environments
160# where for regulations or other security concerns, RDB files persisted on
161# disk by masters in order to feed replicas, or stored on disk by replicas
162# in order to load them for the initial synchronization, should be deleted
163# ASAP. Note that this option ONLY WORKS in instances that have both AOF
164# and RDB persistence disabled, otherwise is completely ignored.
165#
166# An alternative (and sometimes better) way to obtain the same effect is
167# to use diskless replication on both master and replicas instances. However
168# in the case of replicas, diskless is not always an option.
169rdb-del-sync-files no
170
171# When a replica loses its connection with the master, or when the replication
172# is still in progress, the replica can act in two different ways:
173#
174# 1) if replica-serve-stale-data is set to 'yes' (the default) the replica will
175#    still reply to client requests, possibly with out of date data, or the
176#    data set may just be empty if this is the first synchronization.
177#
178# 2) If replica-serve-stale-data is set to 'no' the replica will reply with error
179#    "MASTERDOWN Link with MASTER is down and replica-serve-stale-data is set to 'no'"
180#    to all data access commands, excluding commands such as:
181#    INFO, REPLICAOF, AUTH, SHUTDOWN, REPLCONF, ROLE, CONFIG, SUBSCRIBE,
182#    UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB, COMMAND, POST,
183#    HOST and LATENCY.
184#
185replica-serve-stale-data yes
186
187# You can configure a replica instance to accept writes or not. Writing against
188# a replica instance may be useful to store some ephemeral data (because data
189# written on a replica will be easily deleted after resync with the master) but
190# may also cause problems if clients are writing to it because of a
191# misconfiguration.
192#
193# Since Redis 2.6 by default replicas are read-only.
194#
195# Note: read only replicas are not designed to be exposed to untrusted clients
196# on the internet. It's just a protection layer against misuse of the instance.
197# Still a read only replica exports by default all the administrative commands
198# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve
199# security of read only replicas using 'rename-command' to shadow all the
200# administrative / dangerous commands.
201replica-read-only yes
202
203# Replication SYNC strategy: disk or socket.
204#
205# New replicas and reconnecting replicas that are not able to continue the
206# replication process just receiving differences, need to do what is called a
207# "full synchronization". An RDB file is transmitted from the master to the
208# replicas.
209#
210# The transmission can happen in two different ways:
211#
212# 1) Disk-backed: The Redis master creates a new process that writes the RDB
213#                 file on disk. Later the file is transferred by the parent
214#                 process to the replicas incrementally.
215# 2) Diskless: The Redis master creates a new process that directly writes the
216#              RDB file to replica sockets, without touching the disk at all.
217#
218# With disk-backed replication, while the RDB file is generated, more replicas
219# can be queued and served with the RDB file as soon as the current child
220# producing the RDB file finishes its work. With diskless replication instead
221# once the transfer starts, new replicas arriving will be queued and a new
222# transfer will start when the current one terminates.
223#
224# When diskless replication is used, the master waits a configurable amount of
225# time (in seconds) before starting the transfer in the hope that multiple
226# replicas will arrive and the transfer can be parallelized.
227#
228# With slow disks and fast (large bandwidth) networks, diskless replication
229# works better.
230repl-diskless-sync yes
231
232# When diskless replication is enabled, it is possible to configure the delay
233# the server waits in order to spawn the child that transfers the RDB via socket
234# to the replicas.
235#
236# This is important since once the transfer starts, it is not possible to serve
237# new replicas arriving, that will be queued for the next RDB transfer, so the
238# server waits a delay in order to let more replicas arrive.
239#
240# The delay is specified in seconds, and by default is 5 seconds. To disable
241# it entirely just set it to 0 seconds and the transfer will start ASAP.
242repl-diskless-sync-delay 5
243
244# When diskless replication is enabled with a delay, it is possible to let
245# the replication start before the maximum delay is reached if the maximum
246# number of replicas expected have connected. Default of 0 means that the
247# maximum is not defined and Redis will wait the full delay.
248#repl-diskless-sync-max-replicas 0
249
250# -----------------------------------------------------------------------------
251# WARNING: Since in this setup the replica does not immediately store an RDB on
252# disk, it may cause data loss during failovers. RDB diskless load + Redis
253# modules not handling I/O reads may cause Redis to abort in case of I/O errors
254# during the initial synchronization stage with the master.
255# -----------------------------------------------------------------------------
256#
257# Replica can load the RDB it reads from the replication link directly from the
258# socket, or store the RDB to a file and read that file after it was completely
259# received from the master.
260#
261# In many cases the disk is slower than the network, and storing and loading
262# the RDB file may increase replication time (and even increase the master's
263# Copy on Write memory and replica buffers).
264# However, when parsing the RDB file directly from the socket, in order to avoid
265# data loss it's only safe to flush the current dataset when the new dataset is
266# fully loaded in memory, resulting in higher memory usage.
267# For this reason we have the following options:
268#
269# "disabled"    - Don't use diskless load (store the rdb file to the disk first)
270# "swapdb"      - Keep current db contents in RAM while parsing the data directly
271#                 from the socket. Replicas in this mode can keep serving current
272#                 dataset while replication is in progress, except for cases where
273#                 they can't recognize master as having a data set from same
274#                 replication history.
275#                 Note that this requires sufficient memory, if you don't have it,
276#                 you risk an OOM kill.
277# "on-empty-db" - Use diskless load only when current dataset is empty. This is
278#                 safer and avoid having old and new dataset loaded side by side
279#                 during replication.
280repl-diskless-load disabled
281
282# Master send PINGs to its replicas in a predefined interval. It's possible to
283# change this interval with the repl_ping_replica_period option. The default
284# value is 10 seconds.
285#
286# repl-ping-replica-period 10
287
288# The following option sets the replication timeout for:
289#
290# 1) Bulk transfer I/O during SYNC, from the point of view of replica.
291# 2) Master timeout from the point of view of replicas (data, pings).
292# 3) Replica timeout from the point of view of masters (REPLCONF ACK pings).
293#
294# It is important to make sure that this value is greater than the value
295# specified for repl-ping-replica-period otherwise a timeout will be detected
296# every time there is low traffic between the master and the replica. The default
297# value is 60 seconds.
298#
299# repl-timeout 60
300
301# Disable TCP_NODELAY on the replica socket after SYNC?
302#
303# If you select "yes" Redis will use a smaller number of TCP packets and
304# less bandwidth to send data to replicas. But this can add a delay for
305# the data to appear on the replica side, up to 40 milliseconds with
306# Linux kernels using a default configuration.
307#
308# If you select "no" the delay for data to appear on the replica side will
309# be reduced but more bandwidth will be used for replication.
310#
311# By default we optimize for low latency, but in very high traffic conditions
312# or when the master and replicas are many hops away, turning this to "yes" may
313# be a good idea.
314repl-disable-tcp-nodelay no
315
316# The replica priority is an integer number published by Redis in the INFO
317# output. It is used by Redis Sentinel in order to select a replica to promote
318# into a master if the master is no longer working correctly.
319#
320# A replica with a low priority number is considered better for promotion, so
321# for instance if there are three replicas with priority 10, 100, 25 Sentinel
322# will pick the one with priority 10, that is the lowest.
323#
324# However a special priority of 0 marks the replica as not able to perform the
325# role of master, so a replica with priority of 0 will never be selected by
326# Redis Sentinel for promotion.
327#
328# By default the priority is 100.
329replica-priority 100
330
331# ACL LOG
332#
333# The ACL Log tracks failed commands and authentication events associated
334# with ACLs. The ACL Log is useful to troubleshoot failed commands blocked
335# by ACLs. The ACL Log is stored in memory. You can reclaim memory with
336# ACL LOG RESET. Define the maximum entry length of the ACL Log below.
337acllog-max-len 128
338
339lazyfree-lazy-eviction no
340lazyfree-lazy-expire no
341lazyfree-lazy-server-del no
342replica-lazy-flush no
343
344# It is also possible, for the case when to replace the user code DEL calls
345# with UNLINK calls is not easy, to modify the default behavior of the DEL
346# command to act exactly like UNLINK, using the following configuration
347# directive:
348lazyfree-lazy-user-del no
349
350# FLUSHDB, FLUSHALL, SCRIPT FLUSH and FUNCTION FLUSH support both asynchronous and synchronous
351# deletion, which can be controlled by passing the [SYNC|ASYNC] flags into the
352# commands. When neither flag is passed, this directive will be used to determine
353# if the data should be deleted asynchronously.
354lazyfree-lazy-user-flush no
355
356# On Linux, it is possible to hint the kernel OOM killer on what processes
357# should be killed first when out of memory.
358#
359# Enabling this feature makes Redis actively control the oom_score_adj value
360# for all its processes, depending on their role. The default scores will
361# attempt to have background child processes killed before all others, and
362# replicas killed before masters.
363#
364# Redis supports these options:
365#
366# no:       Don't make changes to oom-score-adj (default).
367# yes:      Alias to "relative" see below.
368# absolute: Values in oom-score-adj-values are written as is to the kernel.
369# relative: Values are used relative to the initial value of oom_score_adj when
370#           the server starts and are then clamped to a range of -1000 to 1000.
371#           Because typically the initial value is 0, they will often match the
372#           absolute values.
373oom-score-adj no
374
375# When oom-score-adj is used, this directive controls the specific values used
376# for master, replica and background child processes. Values range -2000 to
377# 2000 (higher means more likely to be killed).
378#
379# Unprivileged processes (not root, and without CAP_SYS_RESOURCE capabilities)
380# can freely increase their value, but not decrease it below its initial
381# settings. This means that setting oom-score-adj to "relative" and setting the
382# oom-score-adj-values to positive values will always succeed.
383oom-score-adj-values 0 200 800
384
385# Usually the kernel Transparent Huge Pages control is set to "madvise" or
386# or "never" by default (/sys/kernel/mm/transparent_hugepage/enabled), in which
387# case this config has no effect. On systems in which it is set to "always",
388# redis will attempt to disable it specifically for the redis process in order
389# to avoid latency problems specifically with fork(2) and CoW.
390# If for some reason you prefer to keep it enabled, you can set this config to
391# "no" and the kernel global to "always".
392disable-thp yes
393
394# By default Redis asynchronously dumps the dataset on disk. This mode is
395# good enough in many applications, but an issue with the Redis process or
396# a power outage may result into a few minutes of writes lost (depending on
397# the configured save points).
398#
399# The Append Only File is an alternative persistence mode that provides
400# much better durability. For instance using the default data fsync policy
401# (see later in the config file) Redis can lose just one second of writes in a
402# dramatic event like a server power outage, or a single write if something
403# wrong with the Redis process itself happens, but the operating system is
404# still running correctly.
405#
406# AOF and RDB persistence can be enabled at the same time without problems.
407# If the AOF is enabled on startup Redis will load the AOF, that is the file
408# with the better durability guarantees.
409#
410# Please check https://redis.io/topics/persistence for more information.
411appendonly no
412
413# The following time is expressed in microseconds, so 1000000 is equivalent
414# to one second. Note that a negative number disables the slow log, while
415# a value of zero forces the logging of every command.
416slowlog-log-slower-than 10000
417
418# There is no limit to this length. Just be aware that it will consume memory.
419# You can reclaim memory used by the slow log with SLOWLOG RESET.
420slowlog-max-len 128
421
422# By default latency monitoring is disabled since it is mostly not needed
423# if you don't have latency issues, and collecting data has a performance
424# impact, that while very small, can be measured under big load. Latency
425# monitoring can easily be enabled at runtime using the command
426# "CONFIG SET latency-monitor-threshold <milliseconds>" if needed.
427latency-monitor-threshold 0
428
429#  By default all notifications are disabled because most users don't need
430#  this feature and the feature has some overhead. Note that if you don't
431#  specify at least one of K or E, no events will be delivered.
432notify-keyspace-events ""
433
434# Hashes are encoded using a memory efficient data structure when they have a
435# small number of entries, and the biggest entry does not exceed a given
436# threshold. These thresholds can be configured using the following directives.
437#hash-max-listpack-entries 512
438#hash-max-listpack-value 64
439
440# Lists are also encoded in a special way to save a lot of space.
441# The number of entries allowed per internal list node can be specified
442# as a fixed maximum size or a maximum number of elements.
443# For a fixed maximum size, use -5 through -1, meaning:
444# -5: max size: 64 Kb  <-- not recommended for normal workloads
445# -4: max size: 32 Kb  <-- not recommended
446# -3: max size: 16 Kb  <-- probably not recommended
447# -2: max size: 8 Kb   <-- good
448# -1: max size: 4 Kb   <-- good
449# Positive numbers mean store up to _exactly_ that number of elements
450# per list node.
451# The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size),
452# but if your use case is unique, adjust the settings as necessary.
453#list-max-listpack-size -2
454
455# Lists may also be compressed.
456# Compress depth is the number of quicklist ziplist nodes from *each* side of
457# the list to *exclude* from compression.  The head and tail of the list
458# are always uncompressed for fast push/pop operations.  Settings are:
459# 0: disable all list compression
460# 1: depth 1 means "don't start compressing until after 1 node into the list,
461#    going from either the head or tail"
462#    So: [head]->node->node->...->node->[tail]
463#    [head], [tail] will always be uncompressed; inner nodes will compress.
464# 2: [head]->[next]->node->node->...->node->[prev]->[tail]
465#    2 here means: don't compress head or head->next or tail->prev or tail,
466#    but compress all nodes between them.
467# 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail]
468# etc.
469list-compress-depth 0
470
471# Sets have a special encoding when a set is composed
472# of just strings that happen to be integers in radix 10 in the range
473# of 64 bit signed integers.
474# The following configuration setting sets the limit in the size of the
475# set in order to use this special memory saving encoding.
476set-max-intset-entries 512
477
478# Sets containing non-integer values are also encoded using a memory efficient
479# data structure when they have a small number of entries, and the biggest entry
480# does not exceed a given threshold. These thresholds can be configured using
481# the following directives.
482#set-max-listpack-entries 128
483#set-max-listpack-value 64
484
485# Similarly to hashes and lists, sorted sets are also specially encoded in
486# order to save a lot of space. This encoding is only used when the length and
487# elements of a sorted set are below the following limits:
488#zset-max-listpack-entries 128
489#zset-max-listpack-value 64
490
491# HyperLogLog sparse representation bytes limit. The limit includes the
492# 16 bytes header. When a HyperLogLog using the sparse representation crosses
493# this limit, it is converted into the dense representation.
494#
495# A value greater than 16000 is totally useless, since at that point the
496# dense representation is more memory efficient.
497#
498# The suggested value is ~ 3000 in order to have the benefits of
499# the space efficient encoding without slowing down too much PFADD,
500# which is O(N) with the sparse encoding. The value can be raised to
501# ~ 10000 when CPU is not a concern, but space is, and the data set is
502# composed of many HyperLogLogs with cardinality in the 0 - 15000 range.
503hll-sparse-max-bytes 3000
504
505# Streams macro node max size / items. The stream data structure is a radix
506# tree of big nodes that encode multiple items inside. Using this configuration
507# it is possible to configure how big a single node can be in bytes, and the
508# maximum number of items it may contain before switching to a new node when
509# appending new stream entries. If any of the following settings are set to
510# zero, the limit is ignored, so for instance it is possible to set just a
511# max entries limit by setting max-bytes to 0 and max-entries to the desired
512# value.
513stream-node-max-bytes 4096
514stream-node-max-entries 100
515
516# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
517# order to help rehashing the main Redis hash table (the one mapping top-level
518# keys to values). The hash table implementation Redis uses (see dict.c)
519# performs a lazy rehashing: the more operation you run into a hash table
520# that is rehashing, the more rehashing "steps" are performed, so if the
521# server is idle the rehashing is never complete and some more memory is used
522# by the hash table.
523#
524# The default is to use this millisecond 10 times every second in order to
525# actively rehash the main dictionaries, freeing memory when possible.
526#
527# If unsure:
528# use "activerehashing no" if you have hard latency requirements and it is
529# not a good thing in your environment that Redis can reply from time to time
530# to queries with 2 milliseconds delay.
531#
532# use "activerehashing yes" if you don't have such hard requirements but
533# want to free memory asap when possible.
534activerehashing yes
535
536# The client output buffer limits can be used to force disconnection of clients
537# that are not reading data from the server fast enough for some reason (a
538# common reason is that a Pub/Sub client can't consume messages as fast as the
539# publisher can produce them).
540#
541# Both the hard or the soft limit can be disabled by setting them to zero.
542client-output-buffer-limit normal 0 0 0
543client-output-buffer-limit replica 256mb 64mb 60
544client-output-buffer-limit pubsub 32mb 8mb 60
545
546# Redis calls an internal function to perform many background tasks, like
547# closing connections of clients in timeout, purging expired keys that are
548# never requested, and so forth.
549#
550# Not all tasks are performed with the same frequency, but Redis checks for
551# tasks to perform according to the specified "hz" value.
552#
553# By default "hz" is set to 10. Raising the value will use more CPU when
554# Redis is idle, but at the same time will make Redis more responsive when
555# there are many keys expiring at the same time, and timeouts may be
556# handled with more precision.
557#
558# The range is between 1 and 500, however a value over 100 is usually not
559# a good idea. Most users should use the default of 10 and raise this up to
560# 100 only in environments where very low latency is required.
561hz 10
562
563# When dynamic HZ is enabled, the actual configured HZ will be used
564# as a baseline, but multiples of the configured HZ value will be actually
565# used as needed once more clients are connected. In this way an idle
566# instance will use very little CPU time while a busy instance will be
567# more responsive.
568dynamic-hz yes
569
570# When a child rewrites the AOF file, if the following option is enabled
571# the file will be fsync-ed every 4 MB of data generated. This is useful
572# in order to commit the file to the disk more incrementally and avoid
573# big latency spikes.
574aof-rewrite-incremental-fsync yes
575
576# When redis saves RDB file, if the following option is enabled
577# the file will be fsync-ed every 4 MB of data generated. This is useful
578# in order to commit the file to the disk more incrementally and avoid
579# big latency spikes.
580rdb-save-incremental-fsync yes
581
582# Jemalloc background thread for purging will be enabled by default
583jemalloc-bg-thread yes
584