Redis查看运行信息,如版本号、部署方式等 您所在的位置:网站首页 redis查看配置信息 Redis查看运行信息,如版本号、部署方式等

Redis查看运行信息,如版本号、部署方式等

2024-01-07 11:36| 来源: 网络整理| 查看: 265

文章目录 问题描述解决方案返回字段含义ServerClientsMemoryPersistenceStatsReplicationCPUCommandstats 常用命令参考文献

问题描述

Redis 查看运行信息

解决方案

主要使用命令 INFO,返回服务器信息和统计信息,可结合使用 Redis Desktop Manager

INFO [section]

参数

参数含义server服务器基本信息clients客户端连接memory内存消耗persistenceRDB和AOF信息stats综合统计replication主/副本复制信息cpuCPU消耗commandstats命令统计cluster集群modules模块keyspace数据库统计errorstats错误统计

还可以取以下参数

参数含义all返回所有部分(不包括模块生成的部分)default默认部分everything包括所有部分和模块

返回字段含义 Server 字段含义redis_versionRedis服务器版本redis_git_sha1Git SHA1redis_git_dirtyGit dirty flagredis_build_idThe build idredis_mode服务器模式,即部署方式,有单机standalone、哨兵sentinel、集群clusteros操作系统arch_bits系统架构位数,32或64位multiplexing_api事件循环机制,如epollatomicvar_apiAtomicvar API used by Redisgcc_version编译Redis的GCC编译器版本process_id服务器进程的PIDprocess_supervisedSupervised system (“upstart”, “systemd”, “unknown” or “no”)run_id识别Redis服务器的随机值,由Sentinel和Cluster使用tcp_portTCP/IP的监听端口server_time_in_usec微秒精度uptime_in_secondsRedis启动后的秒数uptime_in_daysRedis启动后的天数hz当前频率configured_hz配置的频率lru_clock每分钟递增的时钟,用于LRU管理executableRedis可执行文件路径config_file配置文件路径

Clients 字段含义connected_clients连接数(不包括来自副本的连接)cluster_connectionsAn approximation of the number of sockets used by the cluster’s busmaxclientsThe value of the maxclients configuration directive. This is the upper limit for the sum of connected_clients, connected_slaves and cluster_connections.client_longest_output_list当前客户端连接中最长的输出列表client_biggest_input_buf当前客户端连接中最大的输入缓冲区blocked_clients阻塞调用中挂起的客户端数量tracking_clientsNumber of clients being tracked (CLIENT TRACKING)clients_in_timeout_tableNumber of clients in the clients timeout tableio_threads_activeFlag indicating if I/O threads are active

Memory 字段含义used_memoryRedis分配的总字节数used_memory_humanRedis分配的总字节数(人类可读)used_memory_rss操作系统查看的Redis分配的字节数used_memory_rss_human操作系统查看的Redis分配的字节数(人类可读)used_memory_peakRedis消耗的峰值内存字节数used_memory_peak_humanRedis消耗的峰值内存(人类可读)used_memory_peak_percThe percentage of used_memory_peak out of used_memoryused_memory_overheadThe sum in bytes of all overheads that the server allocated for managing its internal data structuresused_memory_startupInitial amount of memory consumed by Redis at startup in bytesused_memory_datasetThe size in bytes of the dataset (used_memory_overhead subtracted from used_memory)used_memory_dataset_percThe percentage of used_memory_dataset out of the net memory usage (used_memory minus used_memory_startup)total_system_memoryThe total amount of memory that the Redis host hastotal_system_memory_humanHuman readable representation of previous valueused_memory_luaLua引擎使用的字节数used_memory_lua_humanHuman readable representation of previous valueused_memory_scriptsNumber of bytes used by cached Lua scriptsused_memory_scripts_humanHuman readable representation of previous valuemaxmemoryThe value of the maxmemory configuration directivemaxmemory_humanHuman readable representation of previous valuemaxmemory_policyThe value of the maxmemory-policy configuration directivemem_fragmentation_ratioused_memory_rss和used_memory之间的比率mem_fragmentation_bytesDelta between used_memory_rss and used_memory. Note that when the total fragmentation bytes is low (few megabytes), a high ratio (e.g. 1.5 and above) is not an indication of an issue.allocator_frag_ratio:Ratio between allocator_active and allocator_allocated. This is the true (external) fragmentation metric (not mem_fragmentation_ratio).allocator_frag_bytes Delta between allocator_active and allocator_allocated. See note about mem_fragmentation_bytes.allocator_rss_ratioRatio between allocator_resident and allocator_active. This usually indicates pages that the allocator can and probably will soon release back to the OS.allocator_rss_bytesDelta between allocator_resident and allocator_activerss_overhead_ratioRatio between used_memory_rss (the process RSS) and allocator_resident. This includes RSS overheads that are not allocator or heap related.rss_overhead_bytesDelta between used_memory_rss (the process RSS) and allocator_residentallocator_allocatedTotal bytes allocated form the allocator, including internal-fragmentation. Normally the same as used_memory.allocator_activeTotal bytes in the allocator active pages, this includes external-fragmentation.allocator_residentTotal bytes resident (RSS) in the allocator, this includes pages that can be released to the OS (by MEMORY PURGE, or just waiting).mem_not_counted_for_evictUsed memory that’s not counted for key eviction. This is basically transient replica and AOF buffers.mem_clients_normalMemory used by normal clientsmem_clients_slavesMemory used by replica clients - Starting Redis 7.0, replica buffers share memory with the replication backlog, so this field can show 0 when replicas don’t trigger an increase of memory usage.mem_aof_bufferTransient memory used for AOF and AOF rewrite buffersmem_replication_backlogMemory used by replication backlogmem_total_replication_buffersTotal memory consumed for replication buffers - Added in Redis 7.0.mem_allocator在编译时选择的内存分配器active_defrag_runningWhen activedefrag is enabled, this indicates whether defragmentation is currently active, and the CPU percentage it intends to utilize.lazyfree_pending_objectsThe number of objects waiting to be freed (as a result of calling UNLINK, or FLUSHDB and FLUSHALL with the ASYNC option)

Persistence 字段含义loading是否正在加载转储文件current_cow_peakThe peak size in bytes of copy-on-write memory while a child fork is runningcurrent_cow_sizeThe size in bytes of copy-on-write memory while a child fork is runningcurrent_fork_percThe percentage of progress of the current fork process. For AOF and RDB forks it is the percentage of current_save_keys_processed out of current_save_keys_total.current_save_keys_processedNumber of keys processed by the current save operationcurrent_save_keys_totalNumber of keys at the beginning of the current save operationrdb_changes_since_last_save自上次转储以来的更改数rdb_bgsave_in_progress正在保存RDB的标志rdb_last_save_time最近一次成功保存RDB的时间戳rdb_last_bgsave_status最近一次RDB保存操作的状态rdb_last_bgsave_time_sec最后一次RDB保存操作的持续时间rdb_current_bgsave_time_secRDB保存操作的持续时间rdb_last_cow_sizeThe size in bytes of copy-on-write memory during the last RDB save operationaof_enabled指示AOF日志记录被激活的标志aof_rewrite_in_progress指示正在进行的AOF重写操作的标志aof_rewrite_scheduled表示一旦正在进行的RDB保存完成,将调度AOF重写操作的标志aof_last_rewrite_time_sec最近一次AOF重写操作的持续时间aof_current_rewrite_time_sec正在进行的AOF重写操作的持续时间aof_last_bgrewrite_status最近一次AOF重写操作的状态aof_last_write_status最近一次对AOF的写操作的状态aof_last_cow_sizeThe size in bytes of copy-on-write memory during the last AOF rewrite operationmodule_fork_in_progressFlag indicating a module fork is on-goingmodule_fork_last_cow_sizeThe size in bytes of copy-on-write memory during the last module fork operation

Stats 字段含义total_connections_received服务器连接总数total_commands_processed服务器处理的命令总数instantaneous_ops_per_sec每秒处理的命令数total_net_input_bytesThe total number of bytes read from the networktotal_net_output_bytesThe total number of bytes written to the networkinstantaneous_input_kbpsThe network’s read rate per second in KB/secinstantaneous_output_kbpsThe network’s write rate per second in KB/secrejected_connections由于最大客户端限制而拒绝的连接数sync_full与副本完全同步的数量sync_partial_ok接受的部分重同步请求的数量sync_partial_err被拒绝的部分重同步请求的数量expired_keys过期j键值总数expired_stale_percThe percentage of keys probably expiredexpired_time_cap_reached_countThe count of times that active expiry cycles have stopped earlyexpire_cycle_cpu_millisecondsThe cumulative amount of time spend on active expiry cyclesevicted_keysNumber of evicted keys due to maxmemory limittotal_eviction_exceeded_timeTotal time used_memory was greater than maxmemory since server startup, in millisecondscurrent_eviction_exceeded_timeThe time passed since used_memory last rose above maxmemory, in millisecondskeyspace_hits主字典中成功查找键的次数keyspace_misses主字典中失败查找键的次数pubsub_channels带有客户端订阅的发布/订阅通道的全局数量pubsub_patterns带有客户端订阅的发布/订阅模式的全局数量latest_fork_usec最新的分叉操作持续时间(微秒)total_forksTotal number of fork operations since the server startmigrate_cached_socketsThe number of sockets open for MIGRATE purposesslave_expires_tracked_keysThe number of keys tracked for expiry purposes (applicable only to writable replicas)active_defrag_hitsNumber of value reallocations performed by active the defragmentation processactive_defrag_missesNumber of aborted value reallocations started by the active defragmentation processactive_defrag_key_hitsNumber of keys that were actively defragmentedactive_defrag_key_missesNumber of keys that were skipped by the active defragmentation processtotal_active_defrag_timeTotal time memory fragmentation was over the limit, in millisecondscurrent_active_defrag_timeThe time passed since memory fragmentation last was over the limit, in millisecondstracking_total_keysNumber of keys being tracked by the servertracking_total_itemsNumber of items, that is the sum of clients number for each key, that are being trackedtracking_total_prefixesNumber of tracked prefixes in server’s prefix table (only applicable for broadcast mode)unexpected_error_repliesNumber of unexpected error replies, that are types of errors from an AOF load or replicationtotal_error_repliesTotal number of issued error replies, that is the sum of rejected commands (errors prior command execution) and failed commands (errors within the command execution)total_reads_processedTotal number of read events processedtotal_writes_processedTotal number of write events processedio_threaded_reads_processedNumber of read events processed by the main and I/O threadsio_threaded_writes_processedNumber of write events processed by the main and I/O threads

Replication 字段含义role主实例为master,副本则取值slavemaster_failover_stateThe state of an ongoing failover, if any.master_replidThe replication ID of the Redis server.master_replid2The secondary replication ID, used for PSYNC after a failover.master_repl_offsetThe server’s current replication offsetsecond_repl_offsetThe offset up to which replication IDs are acceptedrepl_backlog_active指示复制积压活动的标志repl_backlog_size复制待定项缓冲区的总大小字节repl_backlog_first_byte_offset复制待定缓冲区的主偏移量repl_backlog_histlen复制待定项缓冲区中数据的字节大小

CPU 字段含义used_cpu_sysRedis服务器消耗的系统CPUused_cpu_userRedis服务器消耗的用户CPUused_cpu_sys_children后台进程占用的系统CPUused_cpu_user_children后台进程占用的用户CPUused_cpu_sys_main_threadSystem CPU consumed by the Redis server main threadused_cpu_user_main_threadUser CPU consumed by the Redis server main thread

Commandstats

命令统计

常用命令

1. 查看版本号和部署方式

INFO server

参考文献 INFO – Redis


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有