Valkey™ settings
For Yandex Managed Service for Valkey™ clusters, you can configure 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 that all of the above interfaces are supported.
Depending on the selected interface, the same setting will be represented 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
You can use the following settings:
-
Activedefrag
Management consoleCLIAPIThis setting enables active memory defragmentation in the cluster. It helps to reduce memory fragmentation, which can lead to insufficient memory issues. We do not recommend enabling this setting if you do not have memory fragmentation issues.
The setting is disabled by default.
For more information, see this Valkey™ article
. -
Client output buffer limit normal
All interfacesSetting a limit on the output buffer for regular clients.
Valkey™ uses an output buffer to store data generated by a query before sending it out to a client. If a client is sending new queries faster than Valkey™ can process pending ones, this causes the buffer to grow.
This setting includes the following parameters:
- Hard limit: Hard buffer size limit (in bytes). If this value is exceeded, the connection with the client will terminate immediately. The minimum value is
0(no limit). The default value is0. In the management console, define units of measurement using the Hard limit unit parameter. - Soft limit: Soft buffer size limit (in bytes). The connection to the client will not terminate unless this value is exceeded for a period of time specified in the Soft seconds parameter. The minimum value is
0(no limit). The default value is0. In the management console, define units of measurement using the Soft limit unit parameter. - Soft seconds: Time (seconds) for which the soft buffer limit may be exceeded. The minimum value is
0. The default value is0.
For more information about this setting, see the Valkey™ documentation
. - Hard limit: Hard buffer size limit (in bytes). If this value is exceeded, the connection with the client will terminate immediately. The minimum value is
-
Client output buffer limit pubsub
All interfacesThis limits the output buffer size for clients using the Pub/Sub
pattern.Valkey™ uses an output buffer to store data generated by a query before sending it out to a client. If a client is sending new queries faster than Valkey™ can process pending ones, this causes the buffer to grow.
This setting includes the following parameters:
- Hard limit: Hard buffer size limit (in bytes). If this value is exceeded, the connection with the client will terminate immediately. The minimum value is
0(no limit). The default value is33554432(32 MB). In the management console, define units of measurement using the Hard limit unit parameter. - Soft limit: Soft buffer size limit (in bytes). The connection to the client will not terminate unless this value is exceeded for a period of time specified in the Soft seconds parameter. The minimum value is
0(no limit). The default value is8388608(8 MB). In the management console, define units of measurement using the Soft limit unit parameter. - Soft seconds: Time (seconds) for which the soft buffer limit may be exceeded. The minimum value is
0; default:60.
For more information about this setting, see the Valkey™ documentation
. - Hard limit: Hard buffer size limit (in bytes). If this value is exceeded, the connection with the client will terminate immediately. The minimum value is
-
Databases
All interfacesNumber of databases.
Valkey™ uses the concept of logical databases isolated from one another. Operations with keys and values in one database do not affect data in other databases. Each database is identified by its own number (from
0toDatabases − 1).The minimum value is
1; the maximum value is2147483647; default: is16.For more information, see this Valkey™ article
.Warning
If you change this parameter, all running Valkey™ nodes will be restarted.
-
Lua time limit
Management consoleCLIAPIMaximum Lua script execution time (in milliseconds).
The 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 minimum value is 1 and the maximum value is 75. The default value is 75.
Note
Decreasing the maximum percentage value will reduce the database capacity. This may be helpful if the database has Out of Memory Killer (OOM Killer) issues.
-
Maxmemory policy
All interfacesThis defines the memory management mode when there is not enough 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(default): Do not delete keys. Return an error if there is not enough memory to insert the data.
For more information, see this Valkey™ article
. -
Notify keyspace events
All interfacesThis setting configures notifications about keyspace events.
Its value is a string with modifiers that manage notification output. The default value is an empty string (notification output is disabled).
For a complete list of modifiers, see the Valkey™ documentation
. -
Slowlog log slower than
All interfacesQueries that run longer than the specified time (in microseconds) are considered slow. Such queries end up in the slow log. If the value is
0, all executed queries will end up in the slow log.The minimum value is
-1(no slow log); the maximum value is9223372036854775807; default:10000.For more information, see this Valkey™ article
. -
Slowlog max len
All interfacesMaximum number of entries in the slow query log. When the log is at its maximum length, before inserting new entries, the oldest ones will be removed.
The minimum value is
0(no slow log); the maximum value is9223372036854775807; default:1000.For more information, see this Valkey™ article
. -
Timeout
All interfacesThe time (in seconds) during which a connection to an inactive client is maintained.
The minimum and default value is
0(connections are not terminated); the maximum value is2147483647.For more information, see this Valkey™ article
.