↑ ↓ select, Enter open, Esc close

Show the Redis cache hit rate

user@server
redis-cli INFO stats | grep -E '^(keyspace_hits|keyspace_misses|evicted_keys|expired_keys):'

Shows the hits and misses counted since the last start, plus evicted and expired keys. The hit rate is hits divided by the sum of both values, and for a WordPress object cache, values above 90 percent are common. If evicted_keys keeps rising, maxmemory is set too low.

Also searched as

  • is redis cache worth it
  • calculate redis hit rate
  • are keys evicted from redis

Related one-liners

All in Redis and Memcached

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.