redis查看统计信息

查看统计信息

在cli下使用info来查看统计信息

>info

# Server
redis_version:6.2.1  #redis版本号
redis_git_sha1:00000000 #git SHA1
redis_git_dirty:0 
redis_build_id:b1484a8552b715db
redis_mode:standalone #redis运行模式
os:Darwin 19.6.0 x86_64 # os版本号
arch_bits:64 # 64位
multiplexing_api:kqueue #调用kqueue算法
atomicvar_api:c11-builtin
gcc_version:4.2.1 #gcc版本号
process_id:5560 #服务器进程PID
process_supervised:no 
run_id:32b74bc59ef61724304ba50fd8c46e4a2322021b #redis随机标识符,用于sentinel和集群
tcp_port:6379  #redis监听端口
server_time_usec:1672295618061439
uptime_in_seconds:39 #redis运行时长
uptime_in_days:0 
hz:10
configured_hz:10
lru_clock:11351234 #以分钟为单位的自增时钟,用于LRU管理
executable:/Users/zhanghe/redis-server #服务执行命令
config_file:  #reids配置文件
io_threads_active:0

# Clients
connected_clients:1 #已连接客户端的数量
cluster_connections:0 # 集群连接数
maxclients:10000 # 最大客户端数量
client_recent_max_input_buffer:32  # 客户端最近最大输入
client_recent_max_output_buffer:0 # 客户端最近最大输出
blocked_clients:0 # 正在等待阻塞命令的客户端数量
tracking_clients:0
clients_in_timeout_table:0

# Memory
used_memory:1075888  # 占用内存,单位byte
used_memory_human:1.03M  #友好的格式输出占用内存
used_memory_rss:745472 #redis进程占用的物理内存
used_memory_rss_human:728.00K
used_memory_peak:1136352 #redis内存消耗峰值
used_memory_peak_human:1.08M
used_memory_peak_perc:94.68%
used_memory_overhead:1027424
used_memory_startup:1009120
used_memory_dataset:48464
used_memory_dataset_perc:72.59%
allocator_allocated:1028768
allocator_active:707584
allocator_resident:707584
total_system_memory:8589934592
total_system_memory_human:8.00G
used_memory_lua:37888  #lua引擎所使用的内存大小
used_memory_lua_human:37.00K
used_memory_scripts:0
used_memory_scripts_human:0B
number_of_cached_scripts:0
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
allocator_frag_ratio:0.69
allocator_frag_bytes:18446744073709230432
allocator_rss_ratio:1.00
allocator_rss_bytes:0
rss_overhead_ratio:1.05
rss_overhead_bytes:37888
mem_fragmentation_ratio:0.72  # =used_memory_rss/used_memory,当大于1时,且两者的值相差较大时,表示存在内存碎片。当used>rss时,表示redis的部分内存被操作系统换出到交换空间了,这种情况下,操作可能会有明显的延迟,因为硬盘速度远慢于内存。当大于1.5时需要择机对服务进行重启;当小于1的时候需要对redis进行数据清理
mem_fragmentation_bytes:-283296
mem_not_counted_for_evict:0
mem_replication_backlog:0
mem_clients_slaves:0
mem_clients_normal:17440
mem_aof_buffer:0
mem_allocator:libc
active_defrag_running:0
lazyfree_pending_objects:0
lazyfreed_objects:0

# Persistence
loading:0 # 记录服务器是否正在载入持久化文件,1为正在加载
current_cow_size:0
current_fork_perc:0.00%
current_save_keys_processed:0
current_save_keys_total:0
rdb_changes_since_last_save:0 #距离上次成功创建持久化文件后,产生了多少次修改数据集的操作
rdb_bgsave_in_progress:0 # 记录了服务器是否正在创建RDB文件,1为正在进行
rdb_last_save_time:1672295579 # 最后一次成功创建RDB文件的时间
rdb_last_bgsave_status:ok #最后一次创建RDB文件的结果是成功还是失败,失败标识为err,如果stop-writes-on-bgsave-error是开启的话,写入redis的操作可能会停止
rdb_last_bgsave_time_sec:-1 #最近一次创建RDB文件耗费的秒数
rdb_current_bgsave_time_sec:-1 #如果服务器正在创建RDB文件,那么这个记录就是当前创建操作已经耗费的描述
rdb_last_cow_size:0
aof_enabled:0 # aof是否开启,1为开启
aof_rewrite_in_progress:0 # 服务器是否正在创建AOF文件
aof_rewrite_scheduled:0 # RDB文件创建完毕之后,是否需要执行预约的AOF重写操作,因为RDB时AOF重写会被阻塞
aof_last_rewrite_time_sec:-1 #最近一次创建AOF文件耗费的时长
aof_current_rewrite_time_sec:-1 # 如果服务器正在创建AOF文件,则该记录为党建爱你创建操作已经耗费的秒数
aof_last_bgrewrite_status:ok # 最近一次创建AOF文件的结果是成功还是失败
aof_last_write_status:ok
aof_last_cow_size:0
module_fork_in_progress:0
module_fork_last_cow_size:0

# Stats
total_connections_received:1  #服务器已接受的连接请求数量(累计值)
total_commands_processed:1 #服务器已执行的命令数量
instantaneous_ops_per_sec:0 # 服务器每秒执行的命令数
total_net_input_bytes:31
total_net_output_bytes:20384
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0 # 因为最大客户端数量限制而被拒绝的连接请求数
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0 #因过期而被自动删除的键数量
expired_stale_perc:0.00 
expired_time_cap_reached_count:0
expire_cycle_cpu_milliseconds:0
evicted_keys:0 # 因内存限制而被驱逐的键数量
keyspace_hits:0 #查找数据库键成功的次数
keyspace_misses:0 #查找数据库键失败的次数
pubsub_channels:0 # 被订阅的频道数量
pubsub_patterns:0 # 被订阅的模式数量
latest_fork_usec:0 # 最近一次fork操作耗费的毫秒数
total_forks:0
migrate_cached_sockets:0
slave_expires_tracked_keys:0
active_defrag_hits:0
active_defrag_misses:0
active_defrag_key_hits:0
active_defrag_key_misses:0
tracking_total_keys:0
tracking_total_items:0
tracking_total_prefixes:0
unexpected_error_replies:0
total_error_replies:0
dump_payload_sanitizations:0
total_reads_processed:2
total_writes_processed:1
io_threaded_reads_processed:0
io_threaded_writes_processed:0

# Replication
role:master  # 当前服务器的角色
connected_slaves:0 #从机的数量
master_failover_state:no-failover
master_replid:97faec46ae4f4ad543fd439e94c4e0a48e92ddce
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:0
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:0.033788  #redis服务器耗费的系统cpu
used_cpu_user:0.021860  #redis服务器耗费的用户cpu
used_cpu_sys_children:0.000000 #后台进程耗费的系统CPU
used_cpu_user_children:0.000000 #后台进程耗费的用户CPU

# Modules

# Errorstats

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=15,expires=0,avg_ttl=0  #记录了数据库的相关统计信息
db2:keys=1,expires=0,avg_ttl=0

当然很多时候是不需要看这么多信息的,如果只需要看某一个模块的信息如何呢?

那就输入info [section] ,如想看Server相关的

info Server

https://zhhll.icu/2022/数据库/非关系型数据库/redis/基础/15.查看统计信息/

本文由mdnice多平台发布

  • 11
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

拾光师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值