redis info参数详解

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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/20625855/viewspace-1712584/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值