Valkey™ settings
For a Yandex Managed Service for Valkey™ cluster, you can set Valkey™ settings.
The label next to the setting name shows which interface can be used to configure this setting: the management console, CLI, API, or Terraform. The All interfaces label means you can use any of the above interfaces.
Depending on the interface you select, the same setting may look differently. For example, Maxmemory policy in the management console is the same as:
maxmemory_policyin the gRPC API and TerraformmaxmemoryPolicyin the REST API
DBMS settings
The following settings are available:
-
Activedefrag
Management consoleCLIAPIThis setting enables active memory defragmentation in the cluster. It helps reduce memory fragmentation, which can cause low-memory issues. We do not recommend enabling it if you do not have memory fragmentation issues.
This setting is disabled by default.
For more information, see this Valkey™ guide
. -
Allow data loss
All interfacesWhen enabled, if the current master fails, the cluster may fail over to a replica that does not contain the most recent records. This may result in data loss. If most hosts reside in a single availability zone, Valkey™ will continue to operate despite the missing records.
When disabled, master failover will be delayed until the replicas are fully synchronized to prevent data loss. However, if more than 50% of hosts fail simultaneously, a new master will not be selected, and write operations will be unavailable. In this case, you will need to manually select a new master, but all data will be preserved and saved after selecting a master and synchronizing replicas.
This setting is disabled by default.
-
Aof max size percent
All interfacesMaximum AOF file size as a percentage of the total disk space. When this limit is exceeded, new write requests are blocked to prevent disk overflow.
The valid values range from
1to100. The default value is99. -
Client output buffer limit normal
All interfacesLimit on the output buffer size for regular clients.
Valkey™ uses an output buffer to temporarily store command-generated data before it reaches the client. If the client is sending new commands faster than Valkey™ can process pending ones, the buffer size increases.
This setting includes the following parameters:
- Hard limit: Hard buffer size limit, in bytes. If this limit is crossed, the client connection terminates immediately. The minimum value is
0, i.e., there is no limit. The default value depends on the network speed limits, which are specific to the VM configuration. To define the units of measurement in the management console, use the Hard limit unit setting. - Soft limit: Soft buffer size limit, in bytes. The client connection terminates only if this limit is exceeded for the period specified in the Soft seconds setting. The minimum value is
0, i.e., there is no limit. The default value is<Hard_limit_value>/2. To define the units of measurement in the management console, use the Soft limit unit setting. - Soft seconds: Time (in seconds) during which the soft buffer limit may be exceeded. The minimum value is
0. The default value is60.
For more information about this setting, see this Valkey™ guide
. - Hard limit: Hard buffer size limit, in bytes. If this limit is crossed, the client connection terminates immediately. The minimum value is
-
Client output buffer limit pubsub
All interfacesLimit on the output buffer size for clients using the Pub/Sub
pattern.Valkey™ uses an output buffer to temporarily store command-generated data before it reaches the client. If the client is sending new commands faster than Valkey™ can process pending ones, the buffer size increases.
This setting includes the following parameters:
- Hard limit: Hard buffer size limit, in bytes. If this limit is crossed, the client connection terminates immediately. The minimum value is
0, i.e., there is no limit. The default value is33554432(32 MB). To define the units of measurement in the management console, use the Hard limit unit setting. - Soft limit: Soft buffer size limit, in bytes. The client connection terminates only if this limit is exceeded for the period specified in the Soft seconds setting. The minimum value is
0, i.e., there is no limit. The default value is8388608(8 MB). To define the units of measurement in the management console, use the Soft limit unit setting. - Soft seconds: Time (in seconds) during which the soft buffer limit may be exceeded. The minimum value is
0and the default is60.
For more information about this setting, see this Valkey™ guide
. - Hard limit: Hard buffer size limit, in bytes. If this limit is crossed, the client connection terminates immediately. The minimum value is
-
Cluster allow pubsubshard when down
All interfacesWhen enabled, hosts are allowed to serve application requests to sharded Pub/Sub channels
and forward them to the dedicated hash slot of the shard even when the cluster is down.This setting is disabled by default.
For more information, see this Valkey™ guide
. -
Cluster allow reads when down
All interfacesWhen enabled, hosts are allowed to serve read requests while the cluster is down. This setting is useful in the following cases:
- The client application does not require data consistency during replica failures or network connectivity issues.
- You need to maintain read access to hosts in one or two shard clusters when the shard's master host is unavailable.
This setting is disabled by default.
For more information, see this Valkey™ guide
. -
Cluster require full coverage
All interfacesWhen enabled, hosts stop accepting queries if at least one hash slot is uncovered (i.e., no available host is serving it). This way, if any of the cluster hash slots are unavailable, the entire cluster becomes unavailable.
This setting is disabled by default. This means available cluster hosts will continue serving requests for those hash slots that remain available.
For more information, see this Valkey™ guide
. -
Databases
All interfacesNumber of databases.
Valkey™ uses logical databases isolated from one another. Operations with keys and values in one database do not affect data in other databases. Each database has a unique number, from
0toDatabases − 1.The valid values range from
1to2147483647. The default value is16.For more information, see this Valkey™ guide
.Warning
Updating this parameter will restart all running Valkey™ nodes.
-
Io threads allowed
All interfacesWhen enabled, read and write operations are processed by separate I/O threads to boost performance of non-sharded clusters. We do not recommend enabling this setting in clusters where hosts have fewer than four CPU cores.
This setting is disabled by default.
For more information, see this Valkey™ guide
. -
Lfu decay time
All interfacesConfigures the
volatile-lfuandallkeys-lfumemory management policies. This setting defines the time interval in minutes after which a key’s LFU counter (key popularity indicator) decays.The minimum value is
0(LFU counter never decays) and the default is1.For more information, see this Valkey™ guide
. -
Lfu log factor
All interfacesConfigures the
volatile-lfuandallkeys-lfumemory management policies. It controls how quickly the LFU counter (key popularity indicator) increases as the frequency of use grows. Effectively, each value sets a precision level for distinguishing between the most and least frequently used keys.The parameter applies on every key access using the following logic:
-
A random number R (0 to 1) is generated.
-
The probability P for incrementing the counter is calculated as follows:
1 / (<current_LFU_counter_value> × lfu_log_factor + 1) -
The counter increments by one if R < P.
The minimum value is
0and the default is10.For more information, see this Valkey™ guide
. -
-
Lua time limit
Management consoleCLIAPIMaximum Lua script execution time, in milliseconds.
The valid values range from
0to5000. The default value is5000. If0, execution time is unlimited.Changes do not affect an already running script.
For more information, see this Valkey™ article
. -
Maxmemory percent
All interfacesMaximum percentage of RAM to allocate for user data on Yandex Managed Service for Valkey™ cluster hosts.
The valid values range from
1to75. The default value is75.Note
Reducing the maximum percentage decreases the database capacity. This may be helpful if the database experiences OOM Killer issues.
-
Maxmemory policy
All interfacesMemory management mode when low on memory.
volatile-lru: Delete keys with expired TTL starting with the least recently used (LRU) one.volatile-lfu: Delete keys with expired TTL starting with the least frequently used (LFU) one.volatile-ttl: Delete keys with expired TTL starting with the shortest TTL one.volatile-random: Delete keys with expired TTL in random order.allkeys-lru: Delete keys regardless of their TTL starting with the least recently used one.allkeys-lfu: Delete keys regardless of their TTL starting with the least frequently used one.allkeys-random: Delete keys regardless of their TTL in any order.noeviction: Do not delete keys and return an error if there is not enough memory to insert data. This is the default setting.
For more information, see this Valkey™ guide
. -
Notify keyspace events
All interfacesKeyspace event notification setting.
The setting value is a string of modifiers that manage notification behavior. The default value is an empty string, i.e., notification is disabled.
For a complete list of modifiers, see this Valkey™ article
. -
Repl backlog size percent
All interfacesSize of the replication log on the master, as a percentage of disk size. The larger the log size, the longer the replica can remain operational if the master is unavailable over the network.
For more information, see this Valkey™ article
. -
Slowlog log slower than
All interfacesCommands running longer than the specified time (in microseconds) are considered slow. Such commands end up in the slow log. If the value is
0, all executed commands are logged.The valid values range from
-1(no slow logging) to9223372036854775807. The default value is10000.For more information, see this Valkey™ guide
. -
Slowlog max len
All interfacesMaximum number of entries in the slow log. When the log reaches this limit, the oldest entries are removed before adding new ones.
The valid values range from
0(no slow logging) to9223372036854775807. The default value is1000.For more information, see this Valkey™ guide
. -
Timeout
All interfacesTime (in seconds) during which connections to inactive clients remain open.
The valid values range from
0(connections stay open) to2147483647.For more information, see this Valkey™ guide
. -
Turn before switchover
All interfacesWhen enabled, the host state management agent switches the replica over to the new master’s host before appointing a new master.
This setting is disabled by default.
-
Use luajit
All interfacesWhen enabled, LuaJIT
is used to process Lua scripts. This can speed up processing if scripts are used extensively.This setting is disabled by default.
-
Zset max listpack entries
All interfacesIf the number of sorted set
elements is below the specified value, a special encoding will apply to the array elements to reduce the occupied space.For more information, see this Valkey™ guide
.