命令:info [section]git
經過給定可選的參數 section ,能夠讓命令只返回某一部分的信息:redis
1)info server 通常 Redis 服務器信息,包含如下域:數據庫
2)info clients 已鏈接客戶端信息,包含如下域:api
3)info memory 內存信息,包含如下域:緩存
在理想狀況下, used_memory_rss 的值應該只比 used_memory 稍微高一點兒。服務器
1)當 rss > used ,且二者的值相差較大時,表示存在(內部或外部的)內存碎片。架構
內存碎片的比率能夠經過 mem_fragmentation_ratio 的值看出。app
2)當 used > rss 時,表示 Redis 的部份內存被操做系統換出到交換空間了,在這種狀況下,操做可能會產生明顯的延遲。tcp
Because Redis does not have control over how its allocations are mapped to memory pages, high used_memory_rss is often the result of a spike in memory usage.lua
當 Redis 釋放內存時,分配器可能會,也可能不會,將內存返還給操做系統。
若是 Redis 釋放了內存,卻沒有將內存返還給操做系統,那麼 used_memory 的值可能和操做系統顯示的 Redis 內存佔用並不一致。查看 used_memory_peak 的值能夠驗證這種狀況是否發生。
4)info section 其餘信息
>info keyspace
# Keyspace
db0:keys=39398,expires=377,avg_ttl=161592736
"
>info memory
# Memory
used_memory:24053688
used_memory_human:22.94M
used_memory_rss:32346112
used_memory_rss_human:30.85M
used_memory_peak:24567704
used_memory_peak_human:23.43M
total_system_memory:8203362304
total_system_memory_human:7.64G
used_memory_lua:37888
used_memory_lua_human:37.00K
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
mem_fragmentation_ratio:1.34
mem_allocator:jemalloc-4.0.3