Skip to content

Commit c0d2a35

Browse files
committed
valkey: update configuration for 9.1.0
1 parent 9433e83 commit c0d2a35

1 file changed

Lines changed: 152 additions & 74 deletions

File tree

valkey/valkey.conf

Lines changed: 152 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -256,18 +256,24 @@ tcp-keepalive 300
256256
# tls-auth-clients optional
257257

258258
# Automatically authenticate TLS clients as Valkey users based on their
259-
# certificates.
259+
# certificate fields. When enabled, the server extracts a value from the
260+
# client's TLS certificate and looks up a matching Valkey user. If found,
261+
# the client is authenticated as that user during the TLS handshake. If no
262+
# match is found, the client remains unauthenticated as the default user.
260263
#
261-
# If set to a field like "CN", the server will extract the corresponding field
262-
# from the client's TLS certificate and attempt to find a Valkey user with the
263-
# same name. If a matching user is found, the client is automatically
264-
# authenticated as that user during the TLS handshake. If no matching user is
265-
# found, the client is connected as the unauthenticated default user. Set to
266-
# "off" to disable automatic user authentication via certificate fields.
264+
# When using this feature, it is recommended to configure users without
265+
# passwords so that authentication is enforced exclusively through client
266+
# certificates, such as `ACL SETUSER URI-user on allcommands allkeys`.
267267
#
268-
# Supported values: CN, off. Default: off.
268+
# Options:
269+
# CN - Use the Common Name from the certificate's Subject field.
270+
# URI - Use the URI from the certificate's Subject Alternative Name (SAN).
271+
# If multiple URI entries exist, the first one matching an enabled
272+
# Valkey user is used.
273+
# off - Disable certificate-based user authentication (default).
269274
#
270-
# tls-auth-clients-user CN
275+
# Example:
276+
# tls-auth-clients-user URI
271277

272278
# By default, a replica does not attempt to establish a TLS connection
273279
# with its primary.
@@ -324,6 +330,16 @@ tcp-keepalive 300
324330
#
325331
# tls-session-cache-timeout 60
326332

333+
# Interval of TLS material reloading in seconds.
334+
# The default value is 0 (disabled, no automatic reload).
335+
# When set to a value greater than 0, the server will periodically check the
336+
# certificate and key files and, if modified, reload the TLS materials. The
337+
# reload work is performed in a background thread, so it does not block the main
338+
# thread.
339+
#
340+
# For example, to reload TLS materials daily:
341+
# tls-auto-reload-interval 86400
342+
327343
################################### RDMA ######################################
328344

329345
# Valkey Over RDMA is experimental, it may be changed or be removed in any minor or major version.
@@ -425,6 +441,7 @@ loglevel notice
425441
#
426442
# - legacy: the default, traditional log format
427443
# - logfmt: a structured log format; see https://www.brandur.org/logfmt
444+
# - json: a structured log format
428445
#
429446
# log-format legacy
430447

@@ -521,6 +538,19 @@ locale-collate ""
521538
#
522539
# extended-redis-compatibility no
523540

541+
# Inform Valkey of the availability zone if running in a cloud environment. Currently
542+
# this is exposed in the INFO and HELLO commands for clients to use. Default is
543+
# the empty string.
544+
#
545+
# availability-zone "zone-name"
546+
547+
# Use a fixed hash seed for hashtable instead of a random one.
548+
# Setting this option makes commands like SCAN return keys in a consistent
549+
# order across restarts and failovers. The seed can be any string up to 256 characters.
550+
# The value is immutable and must be provided only at server startup.
551+
#
552+
# hash-seed example-seed-val
553+
524554
################################ SNAPSHOTTING ################################
525555

526556
# Save the DB to disk.
@@ -805,10 +835,21 @@ repl-diskless-load disabled
805835
# generally beneficial as it prevents potential performance degradation on the primary
806836
# server, which is typically handling more critical operations.
807837
#
838+
# During the dual channel full sync, the maximum size of the local replication buffer
839+
# on the replica is limited by the hard limit of the replica client output buffer on
840+
# the replica side. When the replica reaches the limit, it will stop accumulating the
841+
# further data. At this point, any additional data accumulation will occur on primary
842+
# side, which is depending on the replica client output buffer on the primary side.
843+
#
808844
# When toggling this configuration on or off during an ongoing synchronization process,
809845
# it does not change the already running sync method. The new configuration will take
810846
# effect only for subsequent synchronization processes.
811-
847+
#
848+
# To enable dual channel replication, both the primary and its replicas should have
849+
# dual-channel-replication-enabled set to yes. Additionally, the primary is required
850+
# to have repl-diskless-sync enabled, as this allows the RDB snapshot to be streamed
851+
# directly over the connection for the dual channel mechanism to function properly.
852+
#
812853
dual-channel-replication-enabled no
813854

814855
# Master send PINGs to its replicas in a predefined interval. It's possible to
@@ -1746,9 +1787,9 @@ aof-timestamp-enabled no
17461787
# the server in the case a write command was already issued by the script when
17471788
# the user doesn't want to wait for the natural termination of the script.
17481789
#
1749-
# The default is 5 seconds. It is possible to set it to 0 or a negative value
1750-
# to disable this mechanism (uninterrupted execution). Note that in the past
1751-
# this config had a different name, which is now an alias, so both of these do
1790+
# The default is 5 seconds. It is possible to set it to 0 to disable this
1791+
# mechanism (uninterrupted execution). Note that in the past this config had a
1792+
# different name, which is now an alias, so both of these do
17521793
# the same:
17531794
# lua-time-limit 5000
17541795
# busy-reply-threshold 5000
@@ -1769,6 +1810,32 @@ aof-timestamp-enabled no
17691810
#
17701811
# cluster-config-file nodes-6379.conf
17711812

1813+
# This option controls how the cluster handles the saving behavior of the
1814+
# "cluster-config-file" file.
1815+
#
1816+
# When cluster metadata changes (e.g., node joins/leaves, slot migrations,
1817+
# failovers), the cluster needs to save the updated configuration to the
1818+
# "cluster-config-file" file.
1819+
#
1820+
# Available options:
1821+
#
1822+
# - sync (default): Synchronously save the config file. If the save fails,
1823+
# the process exits immediately. This is the traditional behavior that
1824+
# prioritizes configuration consistency.
1825+
#
1826+
# - best-effort: Synchronously save the config file. If the save fails,
1827+
# only log a warning and continue running. The node will retry saving
1828+
# on the next configuration change. Passive exit may bring unexpected
1829+
# effects, such as cluster down. This mode allows the node to survive
1830+
# temporary disk failures, giving administrators time to address the
1831+
# issue without causing immediate service disruption.
1832+
#
1833+
# Note: The 'best-effort' mode is particularly useful in some environments.
1834+
# However, if the disk issue persists and the node restarts, it may load
1835+
# stale configuration data. Use with caution and ensure proper monitoring.
1836+
#
1837+
# cluster-config-save-behavior sync
1838+
17721839
# Cluster node timeout is the amount of milliseconds a node must be unreachable
17731840
# for it to be considered in failure state.
17741841
# Most other internal time limits are a multiple of the node timeout.
@@ -1994,10 +2061,14 @@ aof-timestamp-enabled no
19942061
# During the CLUSTER MIGRATESLOTS command execution, the source node needs to pause itself and allow all
19952062
# writes to be fully processed by the target node. The amount of data remaining in the buffer on the
19962063
# source node when this pause happens will affect how long this pause takes.
2064+
#
19972065
# 'slot-migration-max-failover-repl-bytes' allows the pause to wait until there are at most this
19982066
# many bytes in the output buffer. Setting this to -1 will disable this limit, and 0 will require
1999-
# no data be in the source output buffer (although this is not a guaranatee the data is fully
2000-
# received by the target).
2067+
# no data be in the source output buffer (although this is not a guarantee the data is fully
2068+
# received by the target).
2069+
#
2070+
# You can check the remaining buffer data size by examining the 'remaining_repl_size' field in the
2071+
# 'CLUSTER GETSLOTMIGRATIONS' command output on the source node.
20012072
#
20022073
# slot-migration-max-failover-repl-bytes 0
20032074

@@ -2234,15 +2305,30 @@ notify-keyspace-events ""
22342305

22352306
############################### ADVANCED CONFIG ###############################
22362307

2237-
# Hashes are encoded using a memory efficient data structure when they have a
2238-
# small number of entries, and the biggest entry does not exceed a given
2239-
# threshold. These thresholds can be configured using the following directives.
2308+
# Valkey uses listpacks for some small hashes, sets, sorted sets, and
2309+
# list nodes.
2310+
# A listpack is a compact, memory-efficient representation that stores multiple
2311+
# elements in a contiguous block of memory. This usually saves memory, but
2312+
# larger listpacks can make some updates or lookups more expensive because more
2313+
# data may need to be traversed or rewritten.
2314+
#
2315+
# The "*-max-listpack-entries" settings limit how many entries can stay in a
2316+
# listpack. The "*-max-listpack-value" settings limit the largest element,
2317+
# field, or value that can stay in a listpack.
2318+
#
2319+
# This section also includes related settings for list compression and for sets
2320+
# that can use intset encoding instead of listpacks.
2321+
#
2322+
# Change these only after measuring your actual dataset and workload.
2323+
#
2324+
# Hashes use listpacks when they have a small number of entries, and the
2325+
# biggest field or value does not exceed the following limits.
22402326
hash-max-listpack-entries 512
22412327
hash-max-listpack-value 64
22422328

2243-
# Lists are also encoded in a special way to save a lot of space.
2244-
# The number of entries allowed per internal list node can be specified
2245-
# as a fixed maximum size or a maximum number of elements.
2329+
# Lists are stored as quicklists, where each internal node is a listpack.
2330+
# The number of entries allowed per listpack node can be specified as a fixed
2331+
# maximum size or a maximum number of elements.
22462332
# For a fixed maximum size, use -5 through -1, meaning:
22472333
# -5: max size: 64 Kb <-- not recommended for normal workloads
22482334
# -4: max size: 32 Kb <-- not recommended
@@ -2256,7 +2342,7 @@ hash-max-listpack-value 64
22562342
list-max-listpack-size -2
22572343

22582344
# Lists may also be compressed.
2259-
# Compress depth is the number of quicklist ziplist nodes from *each* side of
2345+
# Compress depth is the number of quicklist nodes from *each* side of
22602346
# the list to *exclude* from compression. The head and tail of the list
22612347
# are always uncompressed for fast push/pop operations. Settings are:
22622348
# 0: disable all list compression
@@ -2271,23 +2357,18 @@ list-max-listpack-size -2
22712357
# etc.
22722358
list-compress-depth 0
22732359

2274-
# Sets have a special encoding when a set is composed
2275-
# of just strings that happen to be integers in radix 10 in the range
2276-
# of 64 bit signed integers.
2277-
# The following configuration setting sets the limit in the size of the
2278-
# set in order to use this special memory saving encoding.
2360+
# Sets containing only integers can use intset encoding.
2361+
# The following setting limits the largest set that can use intset encoding.
22792362
set-max-intset-entries 512
22802363

2281-
# Sets containing non-integer values are also encoded using a memory efficient
2282-
# data structure when they have a small number of entries, and the biggest entry
2283-
# does not exceed a given threshold. These thresholds can be configured using
2284-
# the following directives.
2364+
# Sets containing non-integer values use listpacks when they have a small
2365+
# number of entries, and the biggest member does not exceed the following
2366+
# limits.
22852367
set-max-listpack-entries 128
22862368
set-max-listpack-value 64
22872369

2288-
# Similarly to hashes and lists, sorted sets are also specially encoded in
2289-
# order to save a lot of space. This encoding is only used when the length and
2290-
# elements of a sorted set are below the following limits:
2370+
# Sorted sets use listpacks when they have a small number of entries, and the
2371+
# biggest member does not exceed the following limits:
22912372
zset-max-listpack-entries 128
22922373
zset-max-listpack-value 64
22932374

@@ -2393,8 +2474,9 @@ client-output-buffer-limit pubsub 32mb 8mb 60
23932474
# memory. The server will attempt to drop the connections using the most
23942475
# memory first. We call this mechanism "client eviction".
23952476
#
2396-
# Client eviction is configured using the maxmemory-clients setting as follows:
2397-
# 0 - client eviction is disabled (default)
2477+
# Client eviction is configured using the maxmemory-clients directive, which is
2478+
# 0 (disabled) by default, because it has a small performance impact under high
2479+
# load. It can be enabled at runtime when needed.
23982480
#
23992481
# A memory value can be used for the client eviction threshold,
24002482
# for example:
@@ -2404,6 +2486,8 @@ client-output-buffer-limit pubsub 32mb 8mb 60
24042486
# is based on a percentage of the maxmemory setting. For example to set client
24052487
# eviction at 5% of maxmemory:
24062488
# maxmemory-clients 5%
2489+
#
2490+
# maxmemory-clients 0
24072491

24082492
# In the server protocol, bulk requests, that are, elements representing single
24092493
# strings, are normally limited to 512 mb. However you can change this limit
@@ -2527,6 +2611,38 @@ rdb-save-incremental-fsync yes
25272611
#
25282612
# prefetch-batch-max-size 16
25292613

2614+
# It is possible to pin different threads and processes of the server to specific
2615+
# CPUs in your system, in order to maximize the performances of the server.
2616+
# This is useful both in order to pin different server threads in different
2617+
# CPUs, but also in order to make sure that multiple server instances running
2618+
# in the same host will be pinned to different CPUs.
2619+
#
2620+
# Normally you can do this using the "taskset" command, however it is also
2621+
# possible to do this via the server configuration directly, both in Linux and FreeBSD.
2622+
#
2623+
# You can pin the server/IO threads, bio threads, aof rewrite child process,
2624+
# bgsave child process and the slot migration process.
2625+
# The syntax to specify the cpu list is the same as the taskset command:
2626+
#
2627+
# Set server/io threads to cpu affinity 0,2,4,6:
2628+
# server-cpulist 0-7:2
2629+
#
2630+
# Set bio threads to cpu affinity 1,3:
2631+
# bio-cpulist 1,3
2632+
#
2633+
# Set aof rewrite child process to cpu affinity 8,9,10,11:
2634+
# aof-rewrite-cpulist 8-11
2635+
#
2636+
# Set bgsave (or slot migration) child process to cpu affinity 1,10,11:
2637+
# bgsave-cpulist 1,10-11
2638+
2639+
# In some cases the server will emit warnings and even refuse to start if it detects
2640+
# that the system is in bad state, it is possible to suppress these warnings
2641+
# by setting the following config which takes a space delimited list of warnings
2642+
# to suppress
2643+
#
2644+
# ignore-warnings ARM64-COW-BUG
2645+
25302646

25312647
########################### ACTIVE DEFRAGMENTATION #######################
25322648
#
@@ -2598,41 +2714,3 @@ rdb-save-incremental-fsync yes
25982714

25992715
# Jemalloc background thread for purging will be enabled by default
26002716
jemalloc-bg-thread yes
2601-
2602-
# It is possible to pin different threads and processes of the server to specific
2603-
# CPUs in your system, in order to maximize the performances of the server.
2604-
# This is useful both in order to pin different server threads in different
2605-
# CPUs, but also in order to make sure that multiple server instances running
2606-
# in the same host will be pinned to different CPUs.
2607-
#
2608-
# Normally you can do this using the "taskset" command, however it is also
2609-
# possible to do this via the server configuration directly, both in Linux and FreeBSD.
2610-
#
2611-
# You can pin the server/IO threads, bio threads, aof rewrite child process,
2612-
# bgsave child process and the slot migration process.
2613-
# The syntax to specify the cpu list is the same as the taskset command:
2614-
#
2615-
# Set server/io threads to cpu affinity 0,2,4,6:
2616-
# server-cpulist 0-7:2
2617-
#
2618-
# Set bio threads to cpu affinity 1,3:
2619-
# bio-cpulist 1,3
2620-
#
2621-
# Set aof rewrite child process to cpu affinity 8,9,10,11:
2622-
# aof-rewrite-cpulist 8-11
2623-
#
2624-
# Set bgsave (or slot migration) child process to cpu affinity 1,10,11:
2625-
# bgsave-cpulist 1,10-11
2626-
2627-
# In some cases the server will emit warnings and even refuse to start if it detects
2628-
# that the system is in bad state, it is possible to suppress these warnings
2629-
# by setting the following config which takes a space delimited list of warnings
2630-
# to suppress
2631-
#
2632-
# ignore-warnings ARM64-COW-BUG
2633-
2634-
# Inform Valkey of the availability zone if running in a cloud environment. Currently
2635-
# this is exposed in the INFO and HELLO commands for clients to use. Default is
2636-
# the empty string.
2637-
#
2638-
# availability-zone "zone-name"

0 commit comments

Comments
 (0)