MEMORY STATS
Syntax
MEMORY STATS
- Available since:
- 4.0.0
- Time complexity:
- O(1)
- ACL categories:
-
@slow
,
The MEMORY STATS
command returns an Array reply about the memory usage of the
server.
The information about memory usage is provided as metrics and their respective values. The following metrics are reported:
peak.allocated
: Peak memory consumed by Redis in bytes (seeINFO
'sused_memory_peak
)total.allocated
: Total number of bytes allocated by Redis using its allocator (seeINFO
'sused_memory
)startup.allocated
: Initial amount of memory consumed by Redis at startup in bytes (seeINFO
'sused_memory_startup
)replication.backlog
: Size in bytes of the replication backlog (seeINFO
'srepl_backlog_active
)clients.slaves
: The total size in bytes of all replicas overheads (output and query buffers, connection contexts)clients.normal
: The total size in bytes of all clients overheads (output and query buffers, connection contexts)cluster.links
: Memory usage by cluster links (Added in Redis 7.0, seeINFO
'smem_cluster_links
).aof.buffer
: The summed size in bytes of AOF related buffers.lua.caches
: the summed size in bytes of the overheads of the Lua scripts' cachesdbXXX
: For each of the server's databases, the overheads of the main and expiry dictionaries (overhead.hashtable.main
andoverhead.hashtable.expires
, respectively) are reported in bytesoverhead.total
: The sum of all overheads, i.e.startup.allocated
,replication.backlog
,clients.slaves
,clients.normal
,aof.buffer
and those of the internal data structures that are used in managing the Redis keyspace (seeINFO
'sused_memory_overhead
)keys.count
: The total number of keys stored across all databases in the serverkeys.bytes-per-key
: The ratio between net memory usage (total.allocated
minusstartup.allocated
) andkeys.count
dataset.bytes
: The size in bytes of the dataset, i.e.overhead.total
subtracted fromtotal.allocated
(seeINFO
'sused_memory_dataset
)dataset.percentage
: The percentage ofdataset.bytes
out of the total memory usagepeak.percentage
: The percentage oftotal.allocated
out ofpeak.allocated
fragmentation
: SeeINFO
'smem_fragmentation_ratio
Return
Array reply: nested list of memory usage metrics and their values
A note about the word slave used in this man page: Starting with Redis 5, if not for backward compatibility, the Redis project no longer uses the word slave. Unfortunately in this command the word slave is part of the protocol, so we'll be able to remove such occurrences only when this API will be naturally deprecated.