Skip to content

Valkey cache

Ownkube runs managed Valkey as a cache deployment. Valkey is in-memory and Redis-compatible, so existing Redis client libraries connect unchanged. Use it for caching, sessions, rate limiting and background job queues.

Screenshot of a managed Valkey cache deployment's Overview tab, showing status, memory and the connection card
  1. Press ⌘ K on the dashboard or click New, then choose Cache.
  2. Pick a box by memory. See Sizes.
  3. Pick the environment and region of the app that will use it.
  4. Click Deploy. The Overview tab shows the host, port, password and a ready-made connection string.

Link the cache from the app’s page or with okctl deploy link <app-id> <cache-id>. Ownkube adds these secret variables to the app and rolls it out:

Terminal window
REDIS_URL=redis://default:password@host:6379
REDIS_HOST=...
REDIS_PORT=6379
REDIS_PASSWORD=...

Any Redis-compatible client reads REDIS_URL as is. The host is a private network address inside the environment. The password is generated at creation and cannot be changed; okctl deploy connection-info <cache-id> prints it when you need it.

A cache bills a flat monthly price for its box. It has no persistent volume, so there is no storage charge, and a sleeping cache bills nothing.

BoxMemoryPrice per month
Cache 0.25256 MiB$2
Cache 0.5512 MiB$3
Cache 11 GiB$5
Cache 22 GiB$9
Cache 44 GiB$16

A cache is bound by memory, not CPU. A Pay as you go account can use up to Cache 1. Resize from Settings > Box: you can move up, not down, and the cache restarts briefly.

Max memory defaults to the box size and is the limit Valkey evicts against. Eviction policy decides what happens when the cache is full:

PolicyBehaviour
allkeys-lru (default)Evict the least recently used key, whether or not it has a TTL. Right for a pure cache.
allkeys-lfuEvict the least frequently used key.
volatile-lru, volatile-lfu, volatile-ttl, volatile-randomOnly evict keys that have a TTL. Keys without one are never dropped.
allkeys-randomEvict a random key.
noevictionReturn an error on writes once full. Right for a queue, where losing an item is worse than a failed push.

The policies are the standard Valkey ones; the Valkey docs describe each in depth.

A cache is private by default. Turn on Public access on the Settings tab to reach it from a local tool or a GUI client. You get a stable public hostname and a TLS-encrypted rediss:// connection string.

The public endpoint finds your cache by the hostname your client sends in the TLS handshake (SNI). Most client libraries send it automatically from the host in the URL. valkey-cli and redis-cli do not, so pass it with --sni:

Terminal window
valkey-cli -u "rediss://default:<password>@<host>:6379" --sni <host>

In a GUI tool such as RedisInsight, set the SNI or server-name field to the same hostname. Without it the connection closes right after the handshake, which most clients report as “Server closed the connection”. okctl connect sets it for you (okctl v0.5.1 and later). Public access is also what the data console and Idle to zero need.

Turn on Idle to zero and a cache nobody is connected to parks itself. The next connection wakes it empty, because a cache keeps nothing across a restart. A sleeping cache bills nothing. See Sleep and wake.