redis-cli INFO, and you can read them in a couple of minutes.
This article follows the shape of a post-mortem: impact, investigation, the discovery, a temporary mitigation, and the longer-term fix. It describes a common pattern, not one specific incident, so you can follow the same order the next time this comes up.
What the impact looks like
top. The plugin settings page reports a connection, so the person who installed it considers the job done and starts looking elsewhere.
It helps to be clear about what an object cache does. WordPress already has an object cache API (wp_cache_get, wp_cache_set), but by default it only lives for one request and is thrown away when PHP finishes. A persistent object cache stores those entries in Redis so the next request can reuse them. Typical entries are autoloaded options, post meta, and term lookups.
An object cache does not store finished HTML pages. That is the job of a page cache. When people expect Redis to act like a page cache, they end up disappointed even when Redis is healthy. So the question is never only whether Redis is connected. The useful question is whether WordPress is getting hits from it.
Working through the investigation
wp-content/object-cache.php. If that file is missing, belongs to another plugin, or was left behind by an old caching plugin, WordPress may not be using Redis at all. If WP-CLI is available and the plugin supports it, wp redis status reports whether the drop-in is valid. Otherwise, open the file and check which plugin wrote it.
Second, make sure you are inspecting the same Redis that WordPress talks to. This step catches a lot of people. A server can run Redis on a TCP port and also on a Unix socket. It can run one instance per user. WordPress can also be pointed at a database index other than 0. Read the connection constants in wp-config.php (host, port, socket path, database, prefix; exact names depend on the plugin) and use the same values with redis-cli.
Third, read the counters. The commands below are read-only and safe on a production instance.
BASH
# Read-only. Add -s /path/to/redis.sock, or -h and -p, to match what WordPress uses.
# If Redis requires a password, authenticate the way your setup expects.
redis-cli INFO stats | grep -E 'keyspace_hits|keyspace_misses|evicted_keys|expired_keys'
redis-cli INFO memory | grep -E 'used_memory_human|maxmemory_human|maxmemory_policy'
redis-cli INFO keyspaceINFO stats are cumulative since Redis started, or since they were last reset. One reading tells you little. Take a reading, load a few pages on the site, then take another reading and compare.
TEXT
# Illustrative output format (values are made up and rounded)
keyspace_hits:20000
keyspace_misses:180000
evicted_keys:95000
expired_keys:3000
used_memory_human:64.00M
maxmemory_human:64.00M
maxmemory_policy:allkeys-lru
db0:keys=40000,expires=1000,avg_ttl=250000The counters that tell you what is wrong
keyspace_hits and keyspace_misses don't move between readings while you browse the site, WordPress is not using this instance. Either the drop-in is not active or the site points somewhere else. Look at INFO keyspace too. If your keys live in db1 but the plugin is configured for another index, or the keyspace has almost no keys, you have found the gap. Customers often show the green Connected badge as proof, so this is usually the first thing a support engineer checks.
If both counters move but misses keep pace with hits or exceed them, the cache is connected but not doing its job. Compute the hit ratio as hits / (hits + misses). On a warmed-up WordPress site, hits should clearly dominate. That is a rule of thumb, not a fixed threshold. A low ratio usually has one of three causes:
- Entries are pushed out before anyone reuses them.
- Something keeps flushing the cache, such as a deploy script, a plugin that flushes on every post save, or another site sharing the same instance.
- The site generates so many unique keys that few of them are ever read twice.
evicted_keys is high and still climbing, and used_memory sits at or near maxmemory, the cache is too small. Redis is doing what it was told, which is to drop older keys to make room for new ones. The sample output above is the classic version of this. The memory limit is reached, evictions are large, and misses far outnumber hits. Redis spends its time throwing data away just before WordPress asks for it again, and every miss becomes a MySQL query.
The maxmemory_policy line matters more than it looks. With noeviction, Redis rejects writes once it reaches the limit and returns OOM errors. Reads still work, so the cache freezes in whatever state it was in. Depending on the plugin, this may show up only in a log. With a volatile-* policy, Redis only evicts keys that have a TTL (time to live). If most WordPress keys have no expiry, which INFO keyspace shows when expires is much lower than keys, Redis has almost nothing it is allowed to evict and ends up in the same OOM situation. A maxmemory of 0 means no limit on 64-bit builds. That avoids evictions, but Redis can grow until it competes with MySQL and PHP for RAM.
The last pattern trips people up: the hit ratio is good, evictions are near zero, and the site is still slow. That means Redis is fine and the bottleneck is elsewhere. Common causes are plugins that run raw $wpdb queries without going through the cache API, slow external HTTP calls during page generation, too few PHP workers, or the lack of a page cache. At that point, stop tuning Redis and start profiling queries and requests.
A temporary mitigation
BASH
# Runtime change only; it is lost on restart unless also written to redis.conf.
# 512mb is an illustrative value. Size it to the RAM your server can actually spare.
redis-cli CONFIG SET maxmemory 512mb
redis-cli CONFIG SET maxmemory-policy allkeys-lru
# Reset the stats counters so the next readings reflect only the new settings.
redis-cli CONFIG RESETSTATallkeys-lru will evict those as well. Managed Redis services often disable or rename CONFIG, in which case the change has to go through the provider's panel.
The fast way to empty a cache is FLUSHALL, and it wipes every database on the instance. Avoid it unless you are certain nothing else lives there. Flushing also does not fix a sizing problem. The cache refills and hits the same wall again.
After the change, browse the site for a while and read INFO stats again. Evictions should stop climbing and the hit ratio should improve as the cache warms up. If neither happens, the problem was never memory. Go back to the bypass and wrong-instance checks.
The longer-term fix
redis.conf, though the path depends on the distro and how Redis was installed. Set maxmemory and maxmemory-policy there explicitly instead of relying on defaults. CONFIG REWRITE can write the running values back to the file, but only if Redis was started with a config file it can write to. Editing the file by hand is more predictable.
Size the cache from what you observe, not from a guess. Let the site run under normal traffic, look at used_memory once evictions stop, and add headroom. Then check that this figure, MySQL's buffers, and your PHP workers all fit in the server's RAM together. A Redis that pushes MySQL into swap trades one slowdown for another.
On servers with more than one WordPress site, isolation matters. A separate Redis instance per site is the cleanest option, because one site's flush or memory spike cannot touch another. If that is not practical, give each site its own database index and a unique key prefix through the plugin's prefix or salt setting. Check what the plugin's flush button actually sends, since flushing a whole database or instance on a shared setup is a common reason other sites lose their cache.
Finally, treat the hit ratio and evicted_keys as metrics you watch, not values you check once. A plugin update, a new WooCommerce extension, or a traffic change can shift the key count enough to undo a sizing that used to be fine. If the counters are healthy and the site is still slow, add a page cache and profile the queries that never touch the object cache.
The practical takeaway: when someone says Redis is enabled but nothing got faster, don't start with the plugin settings. Run redis-cli INFO twice with some page loads in between and compare. Counters that don't move point to a connection problem. Rising evictions point to a sizing problem. A good hit ratio on a slow site points to a bottleneck somewhere other than Redis.