KeiruaProd

I help my clients acquire new users and make more money with their web businesses. I have ten years of experience with SaaS projects. If that’s something you need help with, we should get in touch!
< Back to article list

Solving Redis out of memory issues

An article helped investigate a memory issue recently: https://ma.ttias.be/redis-oom-command-not-allowed-used-memory-maxmemory/

TL;DR:

Some commands I’ve found useful are:

redis-cli -h my.host.com -p port_id -a my-plaintext-password

within redis-cli:

also:

Sample outputs

redis-cli 
> info memory
# Memory
used_memory_human:49.96M
…
redis-cli --stat
------- data ------ --------------------- load -------------------- - child -
keys       mem      clients blocked requests            connections          
4          49.89M   15      5       91088 (+0)          4217        
4          49.89M   15      6       91106 (+18)         4217        
4          49.97M   15      6       91124 (+18)         4218        
4          49.93M   15      6       91141 (+17)         4218        
redis-cli --bigkeys

# Scanning the entire keyspace to find biggest keys as well as
# average sizes per key type.  You can use -i 0.1 to sleep 0.1 sec
# per 100 SCAN commands (not usually needed).

[00.00%] Biggest hash   found so far 'xxxxx.' with 8 fields

-------- summary -------

Sampled 1 keys in the keyspace!
Total key length in bytes is 13 (avg len 13.00)

Biggest   hash found 'xxxxx.' has 8 fields

0 strings with 0 bytes (00.00% of keys, avg size 0.00)
0 lists with 0 items (00.00% of keys, avg size 0.00)
1 hashs with 8 fields (100.00% of keys, avg size 8.00)
0 streams with 0 entries (00.00% of keys, avg size 0.00)
0 sets with 0 members (00.00% of keys, avg size 0.00)
0 zsets with 0 members (00.00% of keys, avg size 0.00)

You May Also Enjoy