redis info引數詳解

hotdog04發表於2015-06-26

127.0.0.1:30001> info all
# Server
redis_version:2.8.17             #redis版本
redis_git_sha1:00000000          #Git SHA1
redis_git_dirty:0                #Git dirty flag
redis_build_id:8520347b161b8e59  #
redis_mode:standalone
os:Linux 2.6.32-431.el6.x86_64 x86_64  #作業系統
arch_bits:64                           #架構32 or 64
multiplexing_api:epoll                 #event loop mechanism used by Redis
gcc_version:4.4.7                #編譯redis server的GCC版本
process_id:44138                 #server的程式號
run_id:eefae9db4375ea11669abcb54a7bd4ef859543c4   #server的隨機id(cluster和sentinel使用)
tcp_port:30001                                    #tcp/ip監控埠
uptime_in_seconds:1437488                         #啟動的總時間(單位秒)
uptime_in_days:16                                 #啟動總時間(單位天)
hz:10 
lru_clock:9049246                                 #每分鐘會遞增的一個clock,用於LRU管理
#+++++++++++++++++
config_file:/etc/redis_30001.cnf                  #配置檔案位置
#+++++++++++++++++

# Clients
#+++++++++++++++++
connected_clients:5                               #client連線總數(包括slave連線)
#+++++++++++++++++
client_longest_output_list:0                      #當前client中最長的output list
client_biggest_input_buf:0                        #當前client中最大的input buffer                 
blocked_clients:0                                 #被阻塞呼叫(blpop,brpop,brpoplpush)阻塞的client數量

# Memory
#+++++++++++++++++
used_memory:81653752              #redis分配的總記憶體
#+++++++++++++++++
used_memory_human:77.87M          #方便人看的方式展示
#+++++++++++++++++
used_memory_rss:88092672          #redis佔用的總記憶體(包括記憶體碎片)
#+++++++++++++++++
used_memory_peak:115633224        #redis佔用的記憶體峰值
used_memory_peak_human:110.28M    #方便人看的方式展示
used_memory_lua:33792             #lua引擎佔用的記憶體
mem_fragmentation_ratio:1.08      #used_memory_rss/used_memory
mem_allocator:jemalloc-3.6.0      #編譯的時候選擇的記憶體分配器版本

理想情況下,used_memory_rss略大於used_memory。
rss>used,差異比較大表示記憶體碎片問題比較嚴重(mem_fragmentation_ratio)
rss

redis不控制它的記憶體分配如何對映到記憶體頁上,所以高的used_memory_rss
經常回導致記憶體使用飆升?

redis釋放記憶體的時候,記憶體被歸還給分配器, 分配器可以選擇把記憶體歸還給
OS,也可能不歸還。所以used_memory和系統檢視的記憶體佔用可能不一致。
used_memory_peak值可以用來檢測這個問題點。


# Persistence
loading:0                             #是否有dump在執行中
rdb_changes_since_last_save:12566146  #上次dump後的修改量
rdb_bgsave_in_progress:0              #是否有RDB save在執行
rdb_last_save_time:1433675118         #Epoch-based timestamp of last successful RDB save
rdb_last_bgsave_status:ok             #最後一次 RDB save操作的狀態
rdb_last_bgsave_time_sec:-1           #最後一次RDB save操作持續時間,單位秒
rdb_current_bgsave_time_sec:-1        #當前執行中的RDB save操作持續時間
aof_enabled:0                         #aof功能是否開啟
aof_rewrite_in_progress:0             #aof的rewraite操作是否在執行
aof_rewrite_scheduled:0               #Flag indicating an AOF rewrite operation will be scheduled once the on-going RDB save is complete.
aof_last_rewrite_time_sec:-1          #最後一次AOF的rewrite操作持續時間
aof_current_rewrite_time_sec:-1       #當前執行中的AOF的rewrite操作的持續時間
aof_last_bgrewrite_status:ok          #上次AOF的rewrite操作狀態
aof_last_write_status:ok              #

change_since_last_save   #最後一次save或者bgsave呼叫後,導致資料集變化的運算元量

開啟AOF,輸出會多出如下幾個狀態key:
aof_current_size:               #AOF current file size
aof_base_size:                  #AOF file size on latest startup or rewrite
aof_pending_rewrite:            #Flag indicating an AOF rewrite operation will be scheduled once the on-going RDB save is complete.
aof_buffer_length:              #Size of the AOF buffer
aof_rewrite_buffer_length:      #Size of the AOF rewrite buffer
aof_pending_bio_fsync:          #Number of fsync pending jobs in background I/O queue
aof_delayed_fsync:              #Delayed fsync counter

如果load操作正在執行中,輸出會多出如下幾個狀態key:
loading_start_time:             #Epoch-based timestamp of the start of the load operation
loading_total_bytes:            #Total file size
loading_loaded_bytes:           #Number of bytes already loaded
loading_loaded_perc:            #Same value expressed as a percentage
loading_eta_seconds:            #ETA in seconds for the load to be complete


# Stats
total_connections_received:29165    #server接受的連線總數
total_commands_processed:17724324   #server處理的命令的總數
instantaneous_ops_per_sec:1         #每秒處理的命令數
rejected_connections:5              #因為超過連線上限被拒絕的連線次數
sync_full:0                         #
sync_partial_ok:0
sync_partial_err:0
expired_keys:241611                 #過期的key的總值
evicted_keys:0                      #因記憶體上限被驅逐的key的總數
keyspace_hits:5342336               #命中的key的總數
keyspace_misses:634178              #miss的key的總數
pubsub_channels:0                   #Global number of pub/sub channels with client subscriptions
pubsub_patterns:0                   #Global number of pub/sub pattern with client subscriptions
latest_fork_usec:0                  #最後一次fork操作持續時間(單位微秒)


# Replication
role:master                         #

如果是slave的話:
master_host:                #Host or IP address of the master
master_port:                #Master listening TCP port
master_link_status:         #Status of the link (up/down)
master_last_io_seconds_ago: #Number of seconds since the last interaction with master
master_sync_in_progress:    #Indicate the master is SYNCing to the slave

如果SYNC操作在執行中:
master_sync_left_bytes:          #Number of bytes left before SYNCing is complete
master_sync_last_io_seconds_ago: #Number of seconds since last transfer I/O during a SYNC operation

如果主從結構的從庫宕了。
master_link_down_since_seconds:  #Number of seconds since the link is down


connected_slaves:0                   #slave的數目

如果有多個從庫:
slaveXXX: id, ip address, port, state

master_repl_offset:0                 #
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:568.61         #redis server消耗的系統CPU
used_cpu_user:428.85        #redis server消耗的使用者CPU
used_cpu_sys_children:0.00  #後臺程式消耗的系統CPU
used_cpu_user_children:0.00 #後臺程式消耗的使用者CPU

# Commandstats

各類命令的統計資訊:呼叫次數,CPU time消耗,每次呼叫的CPU消耗

cmdstat_get:calls=5134212,usec=3687784,usec_per_call=0.72
cmdstat_set:calls=11723842,usec=15938668,usec_per_call=1.36
cmdstat_expire:calls=842302,usec=3085886,usec_per_call=3.66
cmdstat_keys:calls=8,usec=70,usec_per_call=8.75
cmdstat_ping:calls=23956,usec=30164,usec_per_call=1.26
cmdstat_flushdb:calls=1,usec=3,usec_per_call=3.00
cmdstat_info:calls=3,usec=146,usec_per_call=48.67

# Cluster
cluster_enabled:1     #是否是叢集

# Keyspace

db0:keys=121058,expires=121057,avg_ttl=55116081
127.0.0.1:30001>

 

 

 


參考:
http://redis.io/commands/info

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20625855/viewspace-1712584/,如需轉載,請註明出處,否則將追究法律責任。