Fictional female specialist examining a Redis latency and memory teaching diagram in a generated scene.

WIUNIX ACADEMY

Redis latency and memory pressure: diagnose eviction before changing policy

Correlate interval counters, resident memory, slow-command metadata and local latency without changing keys or persistence.

Advanced35 min readUpdated
Make this guide yours

YOUR SYSTEM. YOUR STEPS.

Where are you working?

Choose your OS and version. The prerequisites, commands and troubleshooting follow your environment.

Ubuntu 26.04 — existing installation checksReviewed against official documentation ·

USE YOUR OWN VALUES

Configure this tutorial

Set the example values for your environment; related explanations and copy panels update together. Never enter passwords, private keys or tokens. Values stay in this tab and are not sent to the server or share links. Check actual DNS, certificates and network policy before running commands.

Different IP addresses, domains or ports? Open the settings below, change the values and select “Apply to tutorial”, then copy the updated commands.

Set values for my environment2 editable values

THE OUTCOME

What will you have at the end?

Correlate interval counters, resident memory, slow-command metadata and local latency without changing keys or persistence.

Supported operating systems and versions

Documented paths for Ubuntu, Debian and Red Hat families with preinstalled compatible products/clients. The first step states each branch’s limits. Service commands were not executed during authoring.

Before you begin

  • Existing authorized service and protected client authentication; use the isolated fixture scope specified below.

A latency spike is not automatically a slow command

A client request includes client queueing, connection setup, network, server execution and reply delivery. SLOWLOG covers server execution rather than the whole request. This guide correlates an existing Redis7.2+ standalone instance through its private Unix socket with application timing. It changes no persistence, memory policy, keys or authentication. Redis Cluster needs per-shard observations and a separate routing analysis.

Keep the investigation bounded and private

Set the existing socket path and observer ACL name, never its password. The CLI asks privately for the password rather than putting it in process arguments. Values stay in this browser tab; Apply updates all examples. The observer needs only the explicitly approved INFO, CONFIG GET, MEMORY, SLOWLOG, LATENCY and PING capabilities. Do not grant a broad admin category merely to silence an ACL error.

01

LET’S BUILD

Verify the installed tools and the host on which commands run

Redis 7.2+ and the matching redis-cli must already be installed. Current vendor testing lists Ubuntu 26.04, Debian 12/13 and specific Rocky/Alma 9/10 minors; Ubuntu 26.10 is not in that list. Its selection is a conditional local-client procedure for an independently approved existing installation, not a claim of vendor support. Verify exact Redis identity and version; do not silently replace Redis with Valkey. Debian-family deployments commonly use /etc/redis/redis.conf and redis-server.service; RPM layouts can use /etc/redis/redis.conf and redis.service. These are discovery hints, not assumptions. The chosen Unix socket is whatever the existing server actually configured; neither /run/redis/redis-server.sock nor /run/redis/redis.sock is guaranteed to exist.

These are documented command paths, not executed compatibility tests. Read /etc/os-release and verify the exact product/version before continuing. Existing accounts, approved network access and protected credentials are prerequisites. Do not restart existing services to provision tools, initialize a database, open a firewall port or alter a system Python installation to make this exercise run.

bash

Approved administration client; node-specific checks only on the existing node

cat /etc/os-release
id
command -v redis-cli
redis-cli --version
python3 --version
test -S "/run/redis/redis-server.sock"
stat -c "%U:%G %a %n" "/run/redis/redis-server.sock"
How do I know it worked?

The OS, tool path and version match the selected procedure; stop before data changes if they do not.

02

LET’S BUILD

Identify process lifetime before comparing counters

Run on the Redis host. Record version, run_id, uptime, role and current memory policy privately. Different run_id or lower uptime between samples means a restart and invalidates direct subtraction. CONFIG GET requests only the named nonsecret settings. A zero maxmemory is no limit at the Redis layer, not infinite host capacity.

bash

Existing Redis host, authorized observer account

redis-cli -s '/run/redis/redis-server.sock' --user 'observer' --askpass INFO server
redis-cli -s '/run/redis/redis-server.sock' --user 'observer' --askpass INFO replication
redis-cli -s '/run/redis/redis-server.sock' --user 'observer' --askpass CONFIG GET maxmemory maxmemory-policy latency-monitor-threshold slowlog-log-slower-than
How do I know it worked?

The instance and unchanged observation window are identifiable.

03

LET’S BUILD

Separate dataset memory from resident memory

Inspect used_memory, RSS, peak, allocator figures, clients, replication/AOF buffers and host pressure together. Maxmemory eviction excludes some transient replication/AOF memory; it is not a process RSS ceiling. Persistence forks can temporarily need copy-on-write headroom. A fragmentation ratio without absolute bytes and dataset size can mislead. Do not disable persistence or run MEMORY PURGE as an incident reflex.

bash

Existing Redis host, authorized observer account

redis-cli -s '/run/redis/redis-server.sock' --user 'observer' --askpass INFO memory
redis-cli -s '/run/redis/redis-server.sock' --user 'observer' --askpass MEMORY STATS
free -m
vmstat 1 5
How do I know it worked?

Dataset growth, RSS/headroom and host pressure are distinguished.

04

LET’S BUILD

Compare two snapshots, not lifetime totals

Collect these counters at the start and end of the incident window using your existing private monitoring or terminal record. Record wall-clock time and run_id each time. Compute eviction rate as delta evicted_keys divided by elapsed seconds; compute interval cache-hit ratio from delta hits/(delta hits+delta misses), only when the denominator is nonzero. A lifetime ratio can hide a recent cache collapse. Do not reset the counters.

bash

Existing Redis host, authorized observer account

date -u +%FT%TZ
redis-cli -s '/run/redis/redis-server.sock' --user 'observer' --askpass INFO server
redis-cli -s '/run/redis/redis-server.sock' --user 'observer' --askpass INFO stats
redis-cli -s '/run/redis/redis-server.sock' --user 'observer' --askpass INFO errorstats
redis-cli -s '/run/redis/redis-server.sock' --user 'observer' --askpass INFO persistence
How do I know it worked?

Comparable intervals identify eviction, misses, OOM errors and persistence overlap.

Explore all tutorials ↗