Сервис хранилища данных

Сервис Valkey

Redis-совместимое хранилище данных для кеширования, очередей, сессий и других задач в памяти.

Вы добавляете этот сервис в стек и выбираете там его версию и ресурсы. Каждое окружение может их переопределить.

В StackMaster

Как Valkey работает в StackMaster

What Wodby sets up for this Valkey service. Check it before adding connection settings or a Valkey configuration file to an application.

How applications reach it

  • Host: the name of this app service inside the environment. Port: 6379. The protocol is the Redis protocol; Redis clients work unchanged.
  • A password is always required. Wodby generates it (token password) and the server starts with requirepass.
  • A service linked to this one receives the host, port and password as environment variables. The names are chosen by the linking service and usually keep the Redis prefix, for example REDIS_HOST, REDIS_PORT and REDIS_PASSWORD, or one REDIS_URL. Read those variables in code; do not hardcode the host or copy the password into the repository.
  • Inside this container the password is in VALKEY_PASSWORD.

Generated configuration

On every start the container renders /etc/valkey.conf from its environment variables and starts valkey-server with it. The file is rewritten on each start: never edit it. Configuration is changed with environment variables on this service, and applies with the next deployment. The variables of this service start with VALKEY_, not REDIS_.

VariableEffectImage default
VALKEY_MAXMEMORYmaxmemory128m
VALKEY_MAXMEMORY_POLICYmaxmemory-policyallkeys-lru
VALKEY_DATABASESnumber of databases16
VALKEY_TIMEOUTidle client timeout, seconds300
VALKEY_SAVE_TO_DISKany value turns persistence onset by Wodby when the data volume exists
VALKEY_APPENDONLY, VALKEY_APPENDFSYNC, VALKEY_SAVESAOF and RDB settings, used only with persistence onyes, everysec, 900:1/300:10/60:10000
VALKEY_NOTIFY_KEYSPACE_EVENTSkeyspace notificationsempty

Eviction and persistence

  • With the defaults this is a cache: once VALKEY_MAXMEMORY is reached, any key can be evicted (allkeys-lru), including keys without a TTL.
  • A job queue, a session store or any data that must not disappear needs VALKEY_MAXMEMORY_POLICY set to noeviction and enough VALKEY_MAXMEMORY. Using the default cache settings as a queue store is the usual mistake: jobs are dropped silently under memory pressure.
  • The data volume is optional. Without it nothing is written to disk (save "", no AOF) and every restart or deployment starts empty. With it, Wodby turns persistence on and data is kept in /data (RDB snapshots plus AOF).
  • The manifest declares no backups, imports or scheduled jobs for this service.

Check the result

From this service's container:

  • valkey-cli -a "$VALKEY_PASSWORD" ping answers PONG.
  • valkey-cli -a "$VALKEY_PASSWORD" config get maxmemory-policy and config get appendonly show the eviction policy and whether persistence is on.
  • valkey-cli -a "$VALKEY_PASSWORD" info keyspace shows which databases hold keys; info stats has evicted_keys.

Обзор

Технический профиль Valkey

Здесь перечислены версии, которые можно выбрать для Valkey в стеке или окружении. Сам сервис публикуется ревизиями, и стек ссылается на конкретную ревизию.

Тип сервиса

Сервис хранилища данных

Версии

9.1, 9.0, 8.1, 7.2

Постоянные тома

Data

Стеки

Стеки, в которые входит Valkey

Valkey входит в эти публичные стеки. Можно создать приложение из публичного стека как есть или добавить сервис в собственный стек.

Конфигурация

Конфигурация сервиса Valkey

Сервис Valkey объявляет следующее. Если значение можно изменить, его задаёт стек, а каждое окружение может его переопределить.

Тома

Data