首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Redis 状态信息详解(3)

Redis 状态信息详解(3)

作者头像
franket
发布2021-10-18 14:57:35
发布2021-10-18 14:57:35
5420
举报
文章被收录于专栏:技术杂记技术杂记

Memory section

Property

Value

used_memory

为Redis 分配的内存总量,单位为 byte

used_memory_human

与 used_memory 相同,只是以更便于阅读的方式进行展示

used_memory_rss

OS分配的常驻内存大小,单位为 byte

used_memory_rss_human

与 used_memory_rss 相同,只是以更便于阅读的方式进行展示

used_memory_peak

Redis 曾使用过的内存峰值

used_memory_peak_human

与 used_memory_peak 相同,只是以更便于阅读的方式进行展示

total_system_memory

系统总内存,单位为 byte

total_system_memory_human

与 total_system_memory 相同,只是以更便于阅读的方式进行展示

used_memory_lua

lua 引擎占用的内存大小

used_memory_lua_human

与 used_memory_lua 相同,只是以更便于阅读的方式进行展示

maxmemory

?

maxmemory_human

?

maxmemory_policy

?

mem_fragmentation_ratio

内存碎片率,是 used_memory_rss 与 used_memory 的比值

mem_allocator

内存的分配方法

理想情况下 used_memory_rss 只会比 used_memory 大一点点

  • 当 rss » used 时,代表有大量的内存碎片
  • 当 used » rss 时,代表有大量的内存被换出到了交换空间

当 Redis 释放了内存后,内存被交还给了内存分配器,但是内存分配器不一定会将内存交还给系统,这时可能导致 used_memory 的值和从系统角度看到的 Redis 消耗不符,这时可以拿 used_memory_peak 作一下参考


Persistence section

Property

Value

loading

用来表明是否正在加载dump数据

rdb_changes_since_last_save

距离上一次dump数据后产生的变更数量

rdb_bgsave_in_progress

用来表明是否有 RDB save 正在执行

rdb_last_save_time

上一次成功进行 RDB save 的时间点

rdb_last_bgsave_status

上一次 RDB save 的最终状态

rdb_last_bgsave_time_sec

上一次 RDB save 持续的时间,单位是秒

rdb_current_bgsave_time_sec

正在进行中的 RDB save 持续的时间

aof_enabled

用来表明 AOF 日志是否打开

aof_rewrite_in_progress

标明 AOF 重写操作是否正在进行

aof_rewrite_scheduled

标明 一旦 RDB save 完成,是否继续进行 AOF 重写操作

aof_last_rewrite_time_sec

上一次 AOF 重写操作的持续时间

aof_current_rewrite_time_sec

当前正在执行的 AOF 操作的持续时间

aof_last_bgrewrite_status

上一次的 AOF 最终反馈状态

aof_last_write_status

如果 AOF 打开了,还会有如下多出来的信息

Property

Value

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

如果加载操作正在进行,还会多出如下的信息

Property

Value

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 section

Property

Value

total_connections_received

实例接收到的总连接数

total_commands_processed

实例处理过的总命令数

instantaneous_ops_per_sec

每秒总处理的命令数

total_net_input_bytes

网络总输入,单位byte

total_net_output_bytes

网络总输出,单位byte

instantaneous_input_kbps

instantaneous_output_kbps

rejected_connections

因为到达最大连接数而拒绝的连接总量

sync_full

sync_partial_ok

sync_partial_err

expired_keys

过期Key累计总量

evicted_keys

由于到到最大内存限制而回收的Key总量

keyspace_hits

数据库中成功找到指定Key的次数

keyspace_misses

数据库中没有成功找到指定Key的次数

pubsub_channels

全局订阅频道的个数

pubsub_patterns

全局订阅频道特征模式的个数

latest_fork_usec

最近的一次 Fork 操作的持续时间,单位是ms

migrate_cached_sockets


Replication section

Property

Value

role

角色,如果复制源,就为 slave,其它情况下都为master

connected_slaves

slave 的连接数

master_repl_offset

repl_backlog_active

repl_backlog_size

repl_backlog_first_byte_offset

repl_backlog_histlen


Property

Value

used_cpu_sys

实例消耗的内核时间

used_cpu_user

实例消耗的用户时间

used_cpu_sys_children

后台处理消耗的内核时间

used_cpu_user_children

后台处理消耗的用户时间


Commandstats section

Property

Value

cmdstat_info

调用总量,时间开销,和平均每个调用的时间花费

cmdstat_command

调用总量,时间开销,和平均每个调用的时间花费


Cluster section

Property

Value

cluster_enabled

标示有没有开启集群


Keyspace section

这里会显示每个数据库中的 Key 统计信息,Key 数量,过期次数,平均TTL时长

Note: 还有很多的不完善,相关信息在持续补充中


命令汇总

  • wget http://download.redis.io/releases/redis-3.2.1.tar.gz
  • tar -zxvf redis-3.2.1.tar.gz
  • cd redis-3.2.1
  • make
  • echo $?
  • cd src/
  • ls | grep -v "\."
  • ./redis-server --help
  • ./redis-server --version
  • redis-server
  • redis-cli -p 6379

原文地址

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Memory section
  • Persistence section
  • Stats section
  • Replication section
  • Commandstats section
  • Cluster section
  • Keyspace section
  • 命令汇总
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档