brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: redis-cli info stats shows the cache hit rate in keyspace_hits and misses

Cache
~/tips/tip-cache-redis-info-stats-hit-rate

redis-cli info stats | grep -E 'keyspace_(hits|misses)|evicted_keys|expired_keys'

Reads the hit and miss counters of a Redis server to calculate how well its cache works.

A Redis cache with a poor hit rate costs memory and gives nothing back.

redis-cli info stats | grep -E 'keyspace_(hits|misses)|evicted_keys|expired_keys'

Hit rate is keyspace_hits / (keyspace_hits + keyspace_misses). evicted_keys counts keys removed because maxmemory was reached, and expired_keys those that ran out of their TTL. Many evictions together with many misses mean the instance is too small or the TTLs are too long. The counters run from the start of the server, so for the current situation reset them with redis-cli config resetstat, wait a while and read them again.

Further reading: Redis: INFO command

Going deeper: Keep a domain pointed at your home with Cloudflare DDNS on Unraid

More Cache tips fincore /var/lib/example/data.db npm cache verify fc-cache -f -v ~/.local/share/fonts proxy_cache app; Cache-Control: no-cache All Cache tips (24) All topics

Link