How to check how much memory occupied by redis at present

created at 07-29-2021 views: 8

steps

redis-cli
auth password # if needed

then as soon as we have activated the command line of redis, we can ues info to check the information we wanted:

127.0.0.1:6379> info

output

# server
redis_version:6.2.4
...

# Clients
...

# Memory
used_memory:5426296
used_memory_human:5.17M
used_memory_rss:12193792
used_memory_rss_human:11.63M
used_memory_peak:8604168
used_memory_peak_human:8.21M
used_memory_peak_perc:63.07%
used_memory_overhead:1112967
used_memory_startup:811848
used_memory_dataset:4313329
used_memory_dataset_perc:93.47%
...
lazyfreed_objects:0

then we can find the memory occupied by redis cache is about 5 Megabytes

created at:07-29-2021
edited at: 07-29-2021: