redis:info详解

来源:互联网 发布:高中教学视频 淘宝网 编辑:程序博客网 时间:2024/05/19 20:40


[root@192.168.56.159 redis6380]redis-cli -a xxx info# Serverredis_version:3.0.7  redis_version: Redis 服务器版本redis_git_sha1:00000000  redis_git_sha1: Git SHA1redis_git_dirty:0  redis_git_dirty: Git dirty flagredis_build_id:4022fe7523cdeee3  redis_mode:standalone  redis_mode:单机or集群os:Linux 2.6.32-358.el6.x86_64 x86_64  os: Redis 服务器的宿主操作系统arch_bits:64  arch_bits: 架构(32 或 64 位)multiplexing_api:epoll  multiplexing_api: Redis 所使用的事件处理机制gcc_version:4.4.7  gcc_version: 编译 Redis 时所使用的 GCC 版本process_id:6206 process_id: 服务器进程的 PIDrun_id:4632606198da81ebf80b7e29a352bd58f9d3a6f1  run_id: Redis 服务器的随机标识符(用于 Sentinel 和集群)tcp_port:6379  tcp_port: TCP/IP 监听端口uptime_in_seconds:199  uptime_in_seconds: 自 Redis 服务器启动以来,经过的秒数uptime_in_days:0  uptime_in_days: 自 Redis 服务器启动以来,经过的天数hz:10lru_clock:10160707   lru_clock: 以分钟为单位进行自增的时钟,用于 LRU 管理config_file:/data/redis/redis6379/redis6379.conf  config_file:redis配置文件# Clientsconnected_clients:2  connected_clients: 已连接客户端的数量(不包括通过从属服务器连接的客户端)client_longest_output_list:0  client_longest_output_list: 当前连接的客户端当中,最长的输出列表client_biggest_input_buf:0  client_biggest_input_buf: 当前连接的客户端当中,最大输入缓存blocked_clients:0  blocked_clients: 正在等待阻塞命令(BLPOP、BRPOP、BRPOPLPUSH)的客户端的数量# Memoryused_memory:1908784   used_memory: 由 Redis 分配器分配的内存总量,以字节(byte)为单位used_memory_human:1.82M   used_memory_human: 以人类可读的格式返回 Redis 分配的内存总量used_memory_rss:2289664   used_memory_rss: 从操作系统的角度,返回 Redis 已分配的内存总量(俗称常驻集大小)。这个值和 top 、 ps 等命令的输出一致。used_memory_peak:1923848   used_memory_peak: Redis 的内存消耗峰值(以字节为单位)used_memory_peak_human:1.83M   used_memory_peak_human: 以人类可读的格式返回 Redis 的内存消耗峰值used_memory_lua:36864   used_memory_lua: Lua 引擎所使用的内存大小(以字节为单位)mem_fragmentation_ratio:1.20   mem_fragmentation_ratio: used_memory_rss 和 used_memory 之间的比率mem_allocator:jemalloc-3.6.0   mem_allocator: 在编译时指定的, Redis 所使用的内存分配器。可以是 libc 、 jemalloc 或者 tcmalloc 。在理想情况下, used_memory_rss 的值应该只比 used_memory 稍微高一点儿。当 rss > used ,且两者的值相差较大时,表示存在(内部或外部的)内存碎片。内存碎片的比率可以通过 mem_fragmentation_ratio 的值看出。当 used > rss 时,表示 Redis 的部分内存被操作系统换出到交换空间了,在这种情况下,操作可能会产生明显的延迟。当 Redis 释放内存时,分配器可能会,也可能不会,将内存返还给操作系统。如果 Redis 释放了内存,却没有将内存返还给操作系统,那么 used_memory 的值可能和操作系统显示的 Redis 内存占用并不一致。查看 used_memory_peak 的值可以验证这种情况是否发生。# Persistenceloading:0   loading:是否正在 load of a dump file 的标记rdb_changes_since_last_save:0   rdb_changes_since_last_save:自从上次save后rdb change的数量rdb_bgsave_in_progress:0   rdb_bgsave_in_progress:是否正常进行bgsaverdb_last_save_time:1469778323   rdb_last_save_time:上次save的unix时间戳rdb_last_bgsave_status:ok   rdb_last_bgsave_status:rdb上次bgsave的状态rdb_last_bgsave_time_sec:0   rdb_last_bgsave_time_sec:上次bgsave的持续时间(s)rdb_current_bgsave_time_sec:-1   rdb_current_bgsave_time_sec:正在bgsave的持续时间(s)aof_enabled:1   aof_enabled:启用AOFaof_rewrite_in_progress:0   aof_rewrite_in_progress:AOF rewrite operation是否正在进行aof_rewrite_scheduled:0   aof_rewrite_scheduled:Flag indicating an AOF rewrite operation will be scheduled once the on-going RDB save is complete.aof_last_rewrite_time_sec:-1  aof_last_rewrite_time_sec:上次AOF rewrite持续时间aof_current_rewrite_time_sec:-1   aof_current_rewrite_time_sec:正在进行的AOF rewrite持续时间aof_last_bgrewrite_status:ok   aof_last_bgrewrite_status:上次AOF rewrite状态aof_last_write_status:okaof_current_size:1021   aof_current_size:AOF当前大小aof_base_size:1021   aof_base_size:AOF file size on latest startup or rewriteaof_pending_rewrite:0   aof_pending_rewrite: Flag indicating an AOF rewrite operation will be scheduled once the on-going RDB save is complete.aof_buffer_length:0   aof_buffer_length: Size of the AOF bufferaof_rewrite_buffer_length:0      aof_rewrite_buffer_length: Size of the AOF rewrite bufferaof_pending_bio_fsync:0   aof_pending_bio_fsync: Number of fsync pending jobs in background I/O queueaof_delayed_fsync:0    aof_delayed_fsync: Delayed fsync counterIf a load operation is on-going, these additional fields will be added:loading_start_time: Epoch-based timestamp of the start of the load operationloading_total_bytes: Total file sizeloading_loaded_bytes: Number of bytes already loadedloading_loaded_perc: Same value expressed as a percentageloading_eta_seconds: ETA in seconds for the load to be complete# Statstotal_connections_received:5   total_connections_received: Total number of connections accepted by the servertotal_commands_processed:192   total_commands_processed: Total number of commands processed by the serverinstantaneous_ops_per_sec:1   instantaneous_ops_per_sec: Number of commands processed per secondtotal_net_input_bytes:6662   total_net_output_bytes:7005instantaneous_input_kbps:0.04instantaneous_output_kbps:0.00rejected_connections:0   rejected_connections: Number of connections rejected because of maxclients limitsync_full:1sync_partial_ok:0sync_partial_err:0expired_keys:0   expired_keys: Total number of key expiration eventsevicted_keys:0   evicted_keys: Number of evicted keys due to maxmemory limitkeyspace_hits:0   keyspace_hits: Number of successful lookup of keys in the main dictionarykeyspace_misses:0   keyspace_misses: Number of failed lookup of keys in the main dictionarypubsub_channels:0   pubsub_channels: Global number of pub/sub channels with client subscriptionspubsub_patterns:0   pubsub_patterns: Global number of pub/sub pattern with client subscriptionslatest_fork_usec:141   latest_fork_usec: Duration of the latest fork operation in microsecondsmigrate_cached_sockets:0# Replicationrole:master   connected_slaves:1slave0:ip=192.168.56.159,port=6380,state=online,offset=239,lag=0master_repl_offset:239repl_backlog_active:1repl_backlog_size:1048576repl_backlog_first_byte_offset:2repl_backlog_histlen:238If the instance is a slave, these additional fields are provided:master_host: Host or IP address of the mastermaster_port: Master listening TCP portmaster_link_status: Status of the link (up/down)master_last_io_seconds_ago: Number of seconds since the last interaction with mastermaster_sync_in_progress: Indicate the master is syncing to the slaveIf a SYNC operation is on-going, these additional fields are provided:master_sync_left_bytes: Number of bytes left before syncing is completemaster_sync_last_io_seconds_ago: Number of seconds since last transfer I/O during a SYNC operationIf the link between master and slave is down, an additional field is provided:master_link_down_since_seconds: Number of seconds since the link is down# CPUused_cpu_sys:0.04   used_cpu_sys: System CPU consumed by the Redis serverused_cpu_user:0.16   used_cpu_user:User CPU consumed by the Redis serverused_cpu_sys_children:0.00   used_cpu_sys_children: System CPU consumed by the background processesused_cpu_user_children:0.00   used_cpu_user_children: User CPU consumed by the background processes# Clustercluster_enabled:0# Keyspacedb0:keys=19,expires=0,avg_ttl=0db1:keys=2,expires=0,avg_ttl=0db2:keys=1,expires=0,avg_ttl=0


# Serverredis_version:2.8.19 ###redis版本号redis_git_sha1:00000000  ###git SHA1redis_git_dirty:0   ###git dirty flagredis_build_id:78796c63e58b72dcredis_mode:standalone   ###redis运行模式os:Linux 2.6.32-431.el6.x86_64 x86_64   ###os版本号arch_bits:64  ###64位架构multiplexing_api:epoll  ###调用epoll算法gcc_version:4.4.7   ###gcc版本号process_id:25899   ###服务器进程PIDrun_id:eae356ac1098c13b68f2b00fd7e1c9f93b1c6a2c   ###Redis的随机标识符(用于sentinel和集群)tcp_port:6379   ###Redis监听的端口号uptime_in_seconds:6419 ###Redis运行时长(s为单位)uptime_in_days:0  ###Redis运行时长(天为单位)hz:10lru_clock:10737922  ###以分钟为单位的自增时钟,用于LRU管理config_file:/etc/redis/redis.conf   ###redis配置文件# Clientsconnected_clients:1   ###已连接客户端的数量(不包括通过从属服务器连接的客户端)这个参数也要一定关注,有飙升和明显下降时都会有问题。即使不操作client_longest_output_list:0   ###当前连接的客户端中最长的输出列表client_biggest_input_buf:0   ###当前连接的客户端中最大的。输出缓存blocked_clients:0  ###正在等待阻塞命令(BLPOP、BRPOP、BRPOPLPUSH)的客户端的数量 需监控# Memoryused_memory:2281560   ###由 Redis 分配器分配的内存总量,以字节(byte)为单位used_memory_human:2.18M   ###以更友好的格式输出redis占用的内存used_memory_rss:2699264   ###从操作系统的角度,返回 Redis 已分配的内存总量(俗称常驻集大小)。这个值和 top 、 ps 等命令的输出一致,包含了used_memory和内存碎片。used_memory_peak:22141272  ### Redis 的内存消耗峰值(以字节为单位)used_memory_peak_human:21.12M  ###以更友好的格式输出redis峰值内存占用used_memory_lua:35840  ###LUA引擎所使用的内存大小mem_fragmentation_ratio:1.18  ###   =used_memory_rss /used_memory 这两个参数都包含保存用户k-v数据的内存和redis内部不同数据结构需要占用的内存,并且RSS指的是包含操作系统给redis实例分配的内存,这里面还包含不连续分配所带来的开销。因此在理想情况下, used_memory_rss 的值应该只比 used_memory 稍微高一点儿。当 rss > used ,且两者的值相差较大时,表示存在(内部或外部的)内存碎片。内存碎片的比率可以通过 mem_fragmentation_ratio 的值看出。当 used > rss 时,表示 Redis 的部分内存被操作系统换出到交换空间了,在这种情况下,操作可能会产生明显的延迟。可以说这个值大于1.5或者小于1都是有问题的。当大于1.5的时候需要择机进行服务器重启。当小于1的时候需要对redis进行数据清理mem_allocator:jemalloc-3.6.0# Persistenceloading:0  ###记录服务器是否正在载入持久化文件,1为正在加载rdb_changes_since_last_save:0   ###距离最近一次成功创建持久化文件之后,产生了多少次修改数据集的操作rdb_bgsave_in_progress:0   ###记录了服务器是否正在创建 RDB 文件,1为正在进行rdb_last_save_time:1420023749  ###最近一次成功创建 RDB 文件的 UNIX 时间戳rdb_last_bgsave_status:ok   ###最近一次创建 RDB 文件的结果是成功还是失败,失败标识为err,这个时候写入redis 的操作可能会停止,因为默认stop-writes-on-bgsave-error是开启的,这个时候如果需要尽快恢复写操作,可以手工将这个选项设置为no。rdb_last_bgsave_time_sec:0  ###最近一次创建 RDB 文件耗费的秒数rdb_current_bgsave_time_sec:-1  ###如果服务器正在创建 RDB 文件,那么这个域记录的就是当前的创建操作已经耗费的秒数aof_enabled:1   ###AOF 是否处于打开状态,1为启用aof_rewrite_in_progress:0   ###服务器是否正在创建 AOF 文件aof_rewrite_scheduled:0   ###RDB 文件创建完毕之后,是否需要执行预约的 AOF 重写操作(因为在RDB时aof的rewrite会被阻塞一直到RDB结束)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_current_size:176265  ###AOF 文件目前的大小aof_base_size:176265  ###服务器启动时或者 AOF 重写最近一次执行之后,AOF 文件的大小aof_pending_rewrite:0  ###是否有 AOF 重写操作在等待 RDB 文件创建完毕之后执行aof_buffer_length:0   ###AOF 缓冲区的大小aof_rewrite_buffer_length:0  ###AOF 重写缓冲区的大小aof_pending_bio_fsync:0  ###后台 I/O 队列里面,等待执行的 fsync 调用数量aof_delayed_fsync:0###被延迟的 fsync 调用数量loading_start_time:1441769386   loading启动时间戳loading_total_bytes:1787767808   loading需要加载数据量loading_loaded_bytes:1587418182  已经加载的数据量loading_loaded_perc:88.79 加载百分比loading_eta_seconds:7   剩余时间# Statstotal_connections_received:8466  ###服务器已接受的连接请求数量,注意这是个累计值。total_commands_processed:900668   ###服务器已执行的命令数量,这个数值需要持续监控,如果在一段时间内出现大范围波动说明系统要么出现大量请求,要么出现执行缓慢的操作。instantaneous_ops_per_sec:1   ###服务器每秒钟执行的命令数量total_net_input_bytes:82724170total_net_output_bytes:39509080instantaneous_input_kbps:0.07instantaneous_output_kbps:0.02rejected_connections:0  ###因为最大客户端数量限制而被拒绝的连接请求数量sync_full:2sync_partial_ok:0sync_partial_err:0expired_keys:0   ###因为过期而被自动删除的数据库键数量evicted_keys:0   ###因为最大内存容量限制而被驱逐(evict)的键数量。这个数值如果不是0则说明maxmemory被触发,并且    evicted_keys一直大于0,则系统的latency增加,此时可以临时提高最大内存,但这只是临时措施,需要从应用着手分析。keyspace_hits:0  ###查找数据库键成功的次数。可以计算命中率keyspace_misses:500000   ###查找数据库键失败的次数。pubsub_channels:0  ###目前被订阅的频道数量pubsub_patterns:0  ###目前被订阅的模式数量latest_fork_usec:402  ###最近一次 fork() 操作耗费的毫秒数# Replicationrole:master   ###如果当前服务器没有在复制任何其他服务器,那么这个域的值就是 master ;否则的话,这个域的值就是 slave 。注意,在创建复制链的时候,一个从服务器也可能是另一个服务器的主服务器connected_slaves:2   ###2个slavesslave0:ip=192.168.65.130,port=6379,state=online,offset=1639,lag=1slave1:ip=192.168.65.129,port=6379,state=online,offset=1639,lag=0master_repl_offset:1639repl_backlog_active:1repl_backlog_size:1048576repl_backlog_first_byte_offset:2repl_backlog_histlen:1638# CPUused_cpu_sys:41.87  ###Redis 服务器耗费的系统 CPUused_cpu_user:17.82  ###Redis 服务器耗费的用户 CPUused_cpu_sys_children:0.01  ###后台进程耗费的系统 CPUused_cpu_user_children:0.01  ###后台进程耗费的用户 CPU# Keyspacedb0:keys=3101,expires=0,avg_ttl=0   ###keyspace 部分记录了数据库相关的统计信息,比如数据库的键数量、数据库过期键数量等。对于每个数据库,这个部分都会添加一行此信息


0 0