How Zenifra Valkey works
This page shows how Zenifra managed Valkey is configured: what changes between the Key‑Value, Cache and Queues profiles, how much memory each plan uses, how data is written and replicated, and how the connection is protected. For day-to-day use, see Key‑Value, Cache and Queues with Valkey.
Summary
| Item | How it works |
|---|---|
| Version | Valkey 9.1 (9.1.2) |
| Profiles | Key‑Value (db-*), Cache (cache-*) and Queues (queue-*) |
| Memory | 80% of the plan's RAM for data (maxmemory) |
| Full memory | Key‑Value and Queues: noeviction; Cache: allkeys-lfu |
| Persistence | Key‑Value and Queues: AOF on disk, with appendfsync everysec; Cache: in memory only |
| Instances | Key‑Value and Queues: 3 (one primary and two replicas) on the basic, premium and enterprise plans; 1 on starter. Cache: 1 |
| Writes | with replicas, the primary only accepts writes with at least 1 connected replica |
| TLS | always, on every connection (valkeys://) |
| User | default, with access to keys and data commands |
Version
- Every Valkey is created and kept on version 9.1.2.
- Version updates are handled by Zenifra.
To check your service's version:
INFO serverThe valkey_version field shows the version.
Profiles
The same Valkey serves three profiles. The profile is chosen at creation and defines persistence, memory policy and replicas.
| Profile | Plans | Disk | maxmemory-policy | AOF |
|---|---|---|---|---|
| Key‑Value | db-starter, db-basic, db-premium, db-enterprise | yes | noeviction | appendonly yes |
| Queues | queue-starter, queue-basic, queue-premium, queue-enterprise | yes | noeviction | appendonly yes |
| Cache | cache-starter, cache-basic, cache-premium, cache-enterprise | no | allkeys-lfu | appendonly no |
Memory and CPU per plan
maxmemory is set at creation and reapplied on every plan change. It applies to each instance.
| Plan | vCPU | RAM | Data (maxmemory) |
|---|---|---|---|
db-starter | 0.3 | 256 MB | 204 MB |
cache-starter, queue-starter | 0.5 | 512 MB | 409 MB |
db-basic, cache-basic, queue-basic | 1 | 1 GB | 819 MB |
db-premium, cache-premium, queue-premium | 2 | 2 GB | 1638 MB |
db-enterprise, cache-enterprise, queue-enterprise | 8 | 8 GB | 6553 MB |
maxmemory: 80% of the plan's RAM, rounded down to whole MB.- Key‑Value and Queues (
noeviction): no key is removed to free space. When memory is full, new writes get the errorOOM command not allowed when used memory > 'maxmemory', and reads keep working. Set a TTL on keys that expire and watch memory usage. - Cache (
allkeys-lfu): when memory is full, Valkey removes the least frequently used keys, with or without a TTL, and writes keep working.
To check on your service:
INFO memoryThe used_memory, maxmemory and maxmemory_policy fields show usage and the limit.
Connections
- The connection string has the format
valkeys://default:<password>@<host>:<port>/0: userdefault, database0and TLS. - Use a connection pool or one shared connection per process. Valkey clients send many commands over one connection, and opening a connection per request only adds latency.
- Configure your application to reconnect on its own. Most clients do this by default.
To see how many connections are open:
INFO clientsThe connected_clients field shows the total.
Persistence
- Key‑Value and Queues write everything to the AOF (
appendonly yes), on disk. The AOF is synced to disk every second (appendfsync everysec). After a restart, Valkey reloads the data from the AOF. - Periodic RDB snapshots are turned off (
save ""): the AOF is the source of the data. - Each instance has its own disk, of the chosen size. The minimum is based on the plan's memory: 3 times 80% of the RAM, rounded up to whole GB, with a minimum of 1 GB.
| Plan | Minimum disk |
|---|---|
db-starter | 1 GB |
queue-starter | 2 GB |
db-basic, queue-basic | 3 GB |
db-premium, queue-premium | 5 GB |
db-enterprise, queue-enterprise | 20 GB |
- Cache keeps data in memory only, with no disk and no AOF. After a restart, the Cache comes back empty, and your application should reload data from the source.
- Profiles with a disk are included in automatic backups.
Replicas and high availability
| Profile | starter | basic, premium, enterprise |
|---|---|---|
| Key‑Value | 1 instance | 3 instances: one primary and two replicas |
| Queues | 1 instance | 3 instances: one primary and two replicas |
| Cache | 1 instance | 1 instance |
- The Console connection always points to the primary. Replicas receive a continuous copy of the data, each on its own disk.
- Instances always run on different servers, close to each other on the network, so a single server failure does not take down the primary and the replicas together.
min-replicas-to-write 1: with replicas, the primary only accepts writes when at least one replica is connected. With no replica connected, writes get the errorNOREPLICAS, and reads keep working.- Each instance counts toward the plan price. For example, a Key‑Value
db-basiccosts 3 times the plan price, plus the additional storage of the 3 instances. See Database Plans. - Changing the plan in the Console accepts plans with the same number of instances: between
db-basic,db-premiumanddb-enterprise(and the same for Queues), and between all Cache plans. To move a Key‑Value or Queue to a smaller plan, the data must fit in up to 90% of the new plan'smaxmemory. See Change the plan.
Restart and recovery
- Automatic primary failover: each instance runs a Valkey Sentinel. If the primary stops answering for 5 seconds, the Sentinels promote a replica (2 of the 3 must agree), and the Console host starts pointing to the new primary. In our tests, writes came back in about 10 seconds. The host and port do not change. It applies to services with replicas created from November 28, 2026.
- When the former primary comes back, it joins as a replica of the new one and receives its data.
- Copying to the replicas is asynchronous, as in any replicated Valkey: during a failover, writes from the last instant before the failure may not have reached any replica.
- On
starterand Cache, which have one instance, the primary restarts on the same host and port. On Key‑Value and Queues, it reloads the data from the AOF. - Replicas detect a lost connection within 10 seconds (
repl-timeout 10) and get a ping from the primary every 2 seconds (repl-ping-replica-period 2), so replication resumes as soon as possible. - During platform maintenance, services with replicas restart one instance at a time.
- Open connections drop during a restart. Configure your application to reconnect and retry idempotent operations.
Encryption and TLS
- In transit: Valkey always uses TLS, including on private connections between applications. The connection string uses
valkeys://. In your client, turn on the TLS option (tls,sslorrediss/valkeys, depending on the library). See Connect to Valkey. - Host: each service has the host
valkey-<id>.managed.zenifra.com. Always connect through it, not through the IP, so the certificate is validated by name. - Between the primary and the replicas: replication uses its own user, separate from the application user, with access only to replication commands.
- At rest: Valkey disks are encrypted.
User and commands
- The application user is
default, with access to all keys and Pub/Sub channels. The password can be rotated at any time. - Server administration (configuration, replication, persistence and version) is handled by Zenifra. Commands in the
@dangerouscategory and theACL,CONFIG,MODULE,SHUTDOWNandREPLICAOFcommands are refused with theNOPERMerror. This includes, for example,KEYS,FLUSHALL,FLUSHDB,DEBUGandSORT. INFOis allowed, so you can follow memory, connections and replication.- To walk through keys, use
SCANwithMATCHandCOUNT. To delete a group of keys, combineSCANwithUNLINKorDEL, or use a TTL.
Next steps
Last updated on
Valkey key-value on Zenifra
Use Zenifra's Valkey Key-Value, with persistent storage, for sessions, shared state, counters and locks, with secure Node.js and Python examples over TLS.
Database Configuration
PostgreSQL and MariaDB on Zenifra: versions and upgrades, instances and replicas, password renewal, public access, failover, backups and storage growth.