码迷,mamicode.com
首页 > 其他好文 > 详细

redis info详解

时间:2021-05-24 07:56:28      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:rip   over   policy   inpu   progress   单机   cron   scribe   running   

官方文档:https://redis.io/commands/info

info主要有一下几项,因版本不同可能略有差别

  • server
  • clients
  • memory
  • persistence
  • stats
  • replication
  • cpu
  • keyspace

 

172.21.194.205:6381> info
# Server
redis_version:5.0.5         #版本号
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:630faaf592fb9db0
redis_mode:standalone      #运行模式,单机或集君
os:Linux 4.4.0-146-generic x86_64    #操作系统版本
arch_bits:64            #架构(32 或 64 位)
multiplexing_api:epoll        #Redis 所使用的事件处理机制
atomicvar_api:atomic-builtin      #原子处理api
gcc_version:5.4.0            #编译 Redis 时所使用的 GCC 版本
process_id:14564            #服务器进程的 PID
run_id:2b9855df83e7e8c249bd86338a900a279921a52d    #Redis 服务器的随机标识符(用于 Sentinel 和集群)
tcp_port:6381              #TCP/IP 监听端口
uptime_in_seconds:61330627        #自 Redis 服务器启动以来,经过的秒数
uptime_in_days:709              #自 Redis 服务器启动以来,经过的天数
hz:10                  #内部调度(进行关闭timeout的客户端,删除过期key等等)频率,程序规定serverCron每秒运行10次。
configured_hz:10
lru_clock:10263371            #自增的时钟,用于LRU管理,该时钟100ms(hz=10,因此每1000ms/10=100ms执行一次定时任务)更新一次
executable:/data/redis6381/src/redis-server  #执行文件
config_file:/data/redis6381/etc/redis.conf    #配置文件路径

# Clients
connected_clients:570          #已连接客户端的数量(不包括通过从属服务器连接的客户端)
client_recent_max_input_buffer:2      #
client_recent_max_output_buffer:0
blocked_clients:0            #正在等待阻塞命令(BLPOP、BRPOP、BRPOPLPUSH)的客户端的数量

# Memory
used_memory:13302112        #由 Redis 分配器分配的内存总量,以字节(byte)为单位
used_memory_human:12.69M      #以人类可读的格式返回 Redis 分配的内存总量
used_memory_rss:11505664      #从操作系统的角度,返回 Redis 已分配的内存总量(俗称常驻集大小)。这个值和 top 、 ps等命令的输出一致。
used_memory_rss_human:10.97M    #以人类可读的格式,从操作系统的角度,返回 Redis 已分配的内存总量(俗称常驻集大小)。这个值和 top 、 ps等命令的输出一致。
used_memory_peak:16252904      #redis的内存消耗峰值(以字节为单位) 
used_memory_peak_human:15.50M    #以人类可读的格式返回redis的内存消耗峰值
used_memory_peak_perc:81.84%    #(used_memory/ used_memory_peak) *100%
used_memory_overhead:10797534    #Redis为了维护数据集的内部机制所需的内存开销,包括所有客户端输出缓冲区、查询缓冲区、AOF重写缓冲区和主从复制的backlog。
used_memory_startup:792384      #Redis服务器启动时消耗的内存
used_memory_dataset:2504578      #used_memory—used_memory_overhead
used_memory_dataset_perc:20.02%    #100%*(used_memory_dataset/(used_memory—used_memory_startup))
allocator_allocated:13801848        
allocator_active:17416192
allocator_resident:24125440
total_system_memory:8370913280    #整个系统内存
total_system_memory_human:7.80G    #以人类可读的格式,显示整个系统内存
used_memory_lua:47104        #Lua脚本存储占用的内存
used_memory_lua_human:46.00K    #以人类可读的格式,显示Lua脚本存储占用的内存
used_memory_scripts:5048        
used_memory_scripts_human:4.93K
number_of_cached_scripts:7
maxmemory:2147483648        #Redis实例的最大内存配置
maxmemory_human:2.00G        #以人类可读的格式,显示Redis实例的最大内存配置
maxmemory_policy:volatile-random    #当达到maxmemory时的淘汰策略
allocator_frag_ratio:1.26        
allocator_frag_bytes:3614344
allocator_rss_ratio:1.39
allocator_rss_bytes:6709248
rss_overhead_ratio:0.48
rss_overhead_bytes:-12619776
mem_fragmentation_ratio:0.87      #used_memory_rss/ used_memory
mem_fragmentation_bytes:-1754192
mem_not_counted_for_evict:1382
mem_replication_backlog:0
mem_clients_slaves:0
mem_clients_normal:9678312
mem_aof_buffer:1382
mem_allocator:jemalloc-5.1.0      #内存分配器
active_defrag_running:0        #0表示没有活动的defrag任务正在运行,1表示有活动的defrag任务正在运行(defrag:表示内存碎片整理)
lazyfree_pending_objects:0      #0表示不存在延迟释放(也有资料翻译未惰性删除)的挂起对象

# Persistence
loading:0          #服务器是否正在载入持久化文件
rdb_changes_since_last_save:363635514    #离最近一次成功生成rdb文件,写入命令的个数,即有多少个写入命令没有持久化
rdb_bgsave_in_progress:0            #服务器是否正在创建rdb文件
rdb_last_save_time:1559545480          #最近一次成功创建rdb文件的时间戳。当前时间戳 - rdb_last_save_time=多少秒未成功生成rdb文件
rdb_last_bgsave_status:ok          #最近一次rdb持久化是否成功
rdb_last_bgsave_time_sec:-1          #最近一次成功生成rdb文件耗时秒数
rdb_current_bgsave_time_sec:-1      #如果服务器正在创建rdb文件,那么这个域记录的就是当前的创建操作已经耗费的秒数
rdb_last_cow_size:0            #RDB过程中父进程与子进程相比执行了多少修改(包括读缓冲区,写缓冲区,数据修改等)
aof_enabled:1              #是否开启了aof
aof_rewrite_in_progress:0        #标识aof的rewrite操作是否在进行中
aof_rewrite_scheduled:0          #rewrite任务计划,当客户端发送bgrewriteaof指令,如果当前rewrite子进程正在执行,那么将客户端请求的bgrewriteaof变为计划任务,待aof子进程结束后执行rewrite
aof_last_rewrite_time_sec:0      #最近一次aof rewrite耗费的时长
aof_current_rewrite_time_sec:-1    #如果rewrite操作正在进行,则记录所使用的时间,单位秒
aof_last_bgrewrite_status:ok      #上次bgrewriteaof操作的状态
aof_last_write_status:ok        #上次aof写入状态
aof_last_cow_size:1126400      #AOF过程中父进程与子进程相比执行了多少修改(包括读缓冲区,写缓冲区,数据修改等)。
aof_current_size:1803418
aof_base_size:147408
aof_pending_rewrite:0
aof_buffer_length:0
aof_rewrite_buffer_length:0
aof_pending_bio_fsync:0
aof_delayed_fsync:0

# Stats
total_connections_received:370489      #新创建连接个数,如果新创建连接过多,过度地创建和销毁连接对性能有影响,说明短连接严重或连接池使用有问题,需调研代码的连接设置
total_commands_processed:1516351409    #redis处理的命令数
instantaneous_ops_per_sec:13        #redis当前的qps,redis内部较实时的每秒执行的命令数
total_net_input_bytes:101240058426      #redis网络入口流量字节数
total_net_output_bytes:14907530934      #redis网络出口流量字节数
instantaneous_input_kbps:0.81        #redis网络入口kps
instantaneous_output_kbps:0.01        #redis网络出口kps
rejected_connections:0            #拒绝的连接个数,redis连接个数达到maxclients限制,拒绝新连接的个数
sync_full:0                #主从完全同步成功次数
sync_partial_ok:0            #主从部分同步成功次数
sync_partial_err:0            #主从部分同步失败次数
expired_keys:47407352        #运行以来过期的key的数量
expired_stale_perc:0.02        #过期的比率
expired_time_cap_reached_count:0    #过期计数
evicted_keys:0            #运行以来剔除(超过了maxmemory后)的key的数量
keyspace_hits:212008375      #命中次数
keyspace_misses:674046179    #没命中次数
pubsub_channels:0          #当前使用中的频道数量
pubsub_patterns:0          #当前使用的模式的数量
latest_fork_usec:521          #最近一次fork操作阻塞redis进程的耗时数,单位微秒
migrate_cached_sockets:0      #是否已经缓存了到该地址的连接
slave_expires_tracked_keys:0      #从实例到期key数量
active_defrag_hits:0          #主动碎片整理命中次数
active_defrag_misses:0        #主动碎片整理未命中次数
active_defrag_key_hits:0        #主动碎片整理key命中次数
active_defrag_key_misses:0      #主动碎片整理key未命中次数

# Replication
role:master        #实例的角色,是master or slave
connected_slaves:0      #连接的slave实例个数
master_replid:108389b212ddd2bb630489c4d71aedf4ef262146      #主实例启动随机字符串
master_replid2:0000000000000000000000000000000000000000    #主实例启动随机字符串2
master_repl_offset:0      #主从同步偏移量,此值如果和上面的offset相同说明主从一致没延迟,与master_replid可被用来标识主实例复制流中的位置。
second_repl_offset:-1      #主从同步偏移量2,此值如果和上面的offset相同说明主从一致没延迟
repl_backlog_active:0      #复制积压缓冲区是否开启
repl_backlog_size:5242880    #复制积压缓冲大小
repl_backlog_first_byte_offset:0    #复制缓冲区里偏移量的大小
repl_backlog_histlen:0      #此值等于 master_repl_offset - repl_backlog_first_byte_offset,该值不会超过repl_backlog_size的大小

# CPU
used_cpu_sys:26637.172000    #将所有redis主进程在核心态所占用的CPU时求和累计起来
used_cpu_user:47870.912000    #将所有redis主进程在用户态所占用的CPU时求和累计起来
used_cpu_sys_children:0.004000  #将后台进程在核心态所占用的CPU时求和累计起来
used_cpu_user_children:0.000000  #将后台进程在用户态所占用的CPU时求和累计起来

# Cluster
cluster_enabled:0      #实例是否启用集群模式

# Keyspace
db2:keys=3404,expires=1486,avg_ttl=59743433      #key的数量,以及带有生存期的key的数,平均存活时间

 

127.0.0.1:6379> info commandstats
# Commandstats
cmdstat_hexists:calls=17749094,usec=27805844,usec_per_call=1.57  
cmdstat_rpush:calls=12379676,usec=30183955,usec_per_call=2.44
cmdstat_expire:calls=15315534,usec=40178637,usec_per_call=2.62
cmdstat_replconf:calls=22,usec=33,usec_per_call=1.50
cmdstat_smembers:calls=1525211,usec=22595473,usec_per_call=14.81
cmdstat_strlen:calls=14,usec=11,usec_per_call=0.79
cmdstat_pexpire:calls=252113762,usec=853731669,usec_per_call=3.39
cmdstat_scard:calls=16418,usec=37704,usec_per_call=2.30
cmdstat_sadd:calls=74548225,usec=205484684,usec_per_call=2.76
cmdstat_setnx:calls=6818308,usec=17312716,usec_per_call=2.54
cmdstat_set:calls=4759021,usec=13317863,usec_per_call=2.80
cmdstat_sscan:calls=31972,usec=301787,usec_per_call=9.44
cmdstat_zrange:calls=452,usec=5032,usec_per_call=11.13
cmdstat_unsubscribe:calls=88,usec=393,usec_per_call=4.47
cmdstat_zcard:calls=41,usec=37,usec_per_call=0.90
cmdstat_ping:calls=36928998,usec=14890246,usec_per_call=0.40
cmdstat_append:calls=74162431,usec=178358833,usec_per_call=2.40
cmdstat_get:calls=40758534147,usec=75129657220,usec_per_call=1.84
cmdstat_select:calls=7567078,usec=4689439,usec_per_call=0.62
cmdstat_multi:calls=343316367,usec=83927870,usec_per_call=0.24
cmdstat_persist:calls=983646,usec=874490,usec_per_call=0.89
cmdstat_punsubscribe:calls=167,usec=1145,usec_per_call=6.86
cmdstat_object:calls=32,usec=43,usec_per_call=1.34
cmdstat_info:calls=2045734,usec=388098482,usec_per_call=189.71
cmdstat_exec:calls=343316367,usec=451387928,usec_per_call=1.31
cmdstat_psubscribe:calls=174,usec=1070,usec_per_call=6.15
cmdstat_hmset:calls=74247231,usec=219629074,usec_per_call=2.96
cmdstat_hincrby:calls=17660252,usec=54736192,usec_per_call=3.10
cmdstat_psync:calls=1,usec=2235,usec_per_call=2235.00
cmdstat_ttl:calls=13917197,usec=7327988,usec_per_call=0.53
cmdstat_rename:calls=832,usec=9140,usec_per_call=10.99
cmdstat_exists:calls=77678252587,usec=57486835271,usec_per_call=0.74
cmdstat_publish:calls=20925650,usec=18318250,usec_per_call=0.88
cmdstat_hset:calls=28843334,usec=185218550,usec_per_call=6.42
cmdstat_slowlog:calls=2,usec=43,usec_per_call=21.50
cmdstat_hgetall:calls=76992910,usec=569582673,usec_per_call=7.40
cmdstat_pttl:calls=3628,usec=3065,usec_per_call=0.84
cmdstat_command:calls=40,usec=35444,usec_per_call=886.10
cmdstat_evalsha:calls=9468478,usec=552873078,usec_per_call=58.39
cmdstat_subscribe:calls=88,usec=378,usec_per_call=4.30
cmdstat_config:calls=192,usec=6287,usec_per_call=32.74
cmdstat_lrange:calls=3,usec=11,usec_per_call=3.67
cmdstat_del:calls=363092083,usec=324624280,usec_per_call=0.89
cmdstat_mset:calls=158,usec=8664,usec_per_call=54.84
cmdstat_type:calls=891,usec=709,usec_per_call=0.80
cmdstat_setex:calls=2909495,usec=11909032,usec_per_call=4.09
cmdstat_lpop:calls=5790922,usec=14128485,usec_per_call=2.44
cmdstat_llen:calls=13636622,usec=12073989,usec_per_call=0.89
cmdstat_scan:calls=446,usec=1815725,usec_per_call=4071.13
cmdstat_keys:calls=238,usec=2490438,usec_per_call=10464.03
cmdstat_psetex:calls=1908686,usec=13302815,usec_per_call=6.97
cmdstat_expireat:calls=6818308,usec=42833872,usec_per_call=6.28
cmdstat_client:calls=1278,usec=904452,usec_per_call=707.71
cmdstat_srem:calls=8900184,usec=35561299,usec_per_call=4.00
cmdstat_eval:calls=46507240,usec=1955627307,usec_per_call=42.05
cmdstat_zadd:calls=4335792,usec=19412546,usec_per_call=4.48

redis info详解

标签:rip   over   policy   inpu   progress   单机   cron   scribe   running   

原文地址:https://www.cnblogs.com/nanxiang/p/14764196.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!