This article will introduce you to the Info command in Redis. I hope it will be helpful to you!
#Redis provides the info command, which returns various information and statistical values about the Redis server. When using Redis, we often encounter some difficult problems that require us to troubleshoot. At this time, we can use the info command to obtain the running status of Redis, and then troubleshoot the problem. [Related recommendations: Redis Video Tutorial]
By giving the optional parameter section, the command can only return a certain part of the information:
server: General information about the Redis server
clients: The connection part of the client
memory: Memory consumption related information
persistence: RDB and AOF related information
stats: general statistics
replication: master/slave replication information
cpu: Statistics of CPU consumption
commandstats: Redis command statistics
cluster: Redis cluster information
keyspace: Database related statistics
It can also take the following values:
- all: Return all Information
- default: Value returns the information of the default settings
If no parameters are used, the default is default and all information is returned.
info/info all
Return all information of Redis service
# Server redis_version:6.2.4 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:fa652e749408dcfd redis_mode:standalone os:Linux 3.10.0-327.el7.x86_64 x86_64 arch_bits:64 multiplexing_api:epoll atomicvar_api:c11-builtin gcc_version:9.3.1 process_id:4617 process_supervised:no run_id:9662797d01b55345cd6cabad38d102e27db19e66 tcp_port:6379 server_time_usec:1632494557942546 uptime_in_seconds:4 uptime_in_days:0 hz:10 configured_hz:10 lru_clock:5104605 executable:/usr/local/soft/redis-6.2.4/src/redis-server config_file:/usr/local/soft/redis-6.2.4/redis.conf io_threads_active:0 # Clients connected_clients:1 cluster_connections:0 maxclients:10000 client_recent_max_input_buffer:16 client_recent_max_output_buffer:0 blocked_clients:0 tracking_clients:0 clients_in_timeout_table:0 # Memory used_memory:874728 used_memory_human:854.23K used_memory_rss:10207232 used_memory_rss_human:9.73M used_memory_peak:932800 used_memory_peak_human:910.94K used_memory_peak_perc:93.77% used_memory_overhead:830808 used_memory_startup:810168 used_memory_dataset:43920 used_memory_dataset_perc:68.03% allocator_allocated:1036080 allocator_active:1380352 allocator_resident:3932160 total_system_memory:1913507840 total_system_memory_human:1.78G used_memory_lua:37888 used_memory_lua_human:37.00K used_memory_scripts:0 used_memory_scripts_human:0B number_of_cached_scripts:0 maxmemory:104857600 maxmemory_human:100.00M maxmemory_policy:volatile-lfu allocator_frag_ratio:1.33 allocator_frag_bytes:344272 allocator_rss_ratio:2.85 allocator_rss_bytes:2551808 rss_overhead_ratio:2.60 rss_overhead_bytes:6275072 mem_fragmentation_ratio:12.27 mem_fragmentation_bytes:9375272 mem_not_counted_for_evict:0 mem_replication_backlog:0 mem_clients_slaves:0 mem_clients_normal:20496 mem_aof_buffer:0 mem_allocator:jemalloc-5.1.0 active_defrag_running:0 lazyfree_pending_objects:0 lazyfreed_objects:0 # Persistence loading:0 current_cow_size:0 current_cow_size_age: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_last_save_time:1632494553 rdb_last_bgsave_status:ok rdb_last_bgsave_time_sec:-1 rdb_current_bgsave_time_sec:-1 rdb_last_cow_size:0 aof_enabled:0 aof_rewrite_in_progress:0 aof_rewrite_scheduled:0 aof_last_rewrite_time_sec:-1 aof_current_rewrite_time_sec:-1 aof_last_bgrewrite_status:ok 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:20324 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 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:5b43385d46f4a601c025cb2c4ce5706b0b77db86 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.030666 used_cpu_user:0.000000 used_cpu_sys_children:0.000000 used_cpu_user_children:0.000000 used_cpu_sys_main_thread:0.030570 used_cpu_user_main_thread:0.000000 # Modules # Errorstats # Cluster cluster_enabled:0 # Keyspace db0:keys=2,expires=0,avg_ttl=0
info server
The following is all server related information
Parameter name | Meaning |
---|---|
redis_version | Redis server version |
redis_git_sha1 | Git SHA1 |
redis_git_dirty | Git dirty flag |
redis_build_id | Build ID |
redis_mode | Server mode (standalone, sentinel or cluster) |
os | Host operating system of Redis server |
arch_bits | Architecture (32 or 64 bits) |
multiplexing_api | Event handling mechanism used by Redis |
atomicvar_api | Atomicvar API used by Redis |
gcc_version | The GCC version used when compiling Redis |
process_id | PID of the server process |
run_id | Random identifier of the Redis server (for Sentinel and cluster) |
tcp_port | TCP/IP listening port |
uptime_in_seconds | Seconds elapsed since the Redis server started Number |
uptime_in_days | The number of days that have passed since the Redis server started |
hz | The server Frequency setting |
lru_clock | A clock that increments in minutes for LRU management |
executable | Server executable file path |
config_file | Configuration file path |
info clients
The following is information related to all clients
Parameter name | Meaning |
---|---|
connected_clients | The number of connected clients (excluding connections via slave servers client) |
client_longest_output_list | The longest output list among the currently connected clients |
client_biggest_input_buf | Maximum input cache among currently connected clients |
blocked_clients | The number of clients that are waiting for blocking commands (BLPOP, BRPOP, BRPOPLPUSH) |
info memory
The following is all memory related information
Parameter name | Meaning | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Assigned by the Redis allocator Total memory, in bytes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the total amount of memory allocated by Redis in human-readable format | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From the perspective of the operating system, returns the total amount of memory allocated by Redis (commonly known as the resident set size). This value is consistent with the output of commands such as top and ps. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Peak memory consumption of Redis in bytes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the peak memory consumption of Redis in human-readable format | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Used memory as a percentage of peak memory | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The sum (in bytes) of all overhead allocated by the server to manage its internal data structures | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Redis at startup Initial memory size consumed (in bytes) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Dataset size in bytes (used_memory minus used_memory_overhead) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
used_memory_dataset as a percentage of net memory usage (used_memory minus used_memory_startup) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Redis The total amount of memory the host has | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the total amount of memory the Redis host has in human-readable format | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The memory size (in bytes) used by the Lua engine | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the Lua engine in human-readable format The size of memory used | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The value of the maxmemory configuration directive | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In human Returns the value of the maxmemory configuration directive in a readable format | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The value of the maxmemory-policy configuration directive | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The ratio between used_memory_rss and used_memory | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Specified at compile time, the memory allocator used by Redis. Can be libc, jemalloc or tcmalloc | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Flag indicating whether active defragmentation is active | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Number of objects waiting to be released (due to calling UNLINK or FLUSHDB and FLUSHALL with the ASYNC option) |
Parameter name | Meaning |
---|---|
Instructions to transfer A flag indicating whether the loading of the dump file is in progress | |
The number of changes since the last dump | |
Flag indicating whether the RDB file is being saved | |
The epoch-based timestamp of the last successful RDB save | |
The status of the last RDB save operation | |
The duration of the last RDB save operation (in seconds) | |
Duration of the ongoing RDB save operation (if any) | |
The size of bytes allocated by copy-on-write during the last RDB save operation | |
Flag indicating that the AOF record has been activated | |
Indicates that the AOF rewrite operation is in progress. | |
Indicates that once it is in progress When the RDB save operation is completed, the AOF rewrite operation will be scheduled. | |
The duration of the last AOF rewrite operation, in seconds | |
The duration of the ongoing AOF rewrite operation (if any) | |
The status of the last AOF rewrite operation | |
The status of the last AOF write operation | |
The byte size allocated by copy-on-write during the last AOF rewrite operation |
AOF
If AOF is enabled, these additional fields are added:
Meaning | |
---|---|
aof_base_size | |
aof_pending_rewrite | |
aof_buffer_length | |
aof_rewrite_buffer_length | |
aof_pending_bio_fsync | |
aof_delayed_fsync | |
If a loading operation is in progress, these additional fields will be added:
Meaning | ##loading_start_time | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
loading_total_bytes | Total file size | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
loading_loaded_bytes | Number of bytes loaded | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
loading_loaded_perc | Percent loaded | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
loading_eta_seconds | Estimated number of seconds remaining until loading is complete | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Parameter name | Meaning |
---|---|
total_connections_received | Total number of connections accepted by the server |
total_commands_processed | Total number of commands processed by the server |
instantaneous_ops_per_sec | Number of commands processed per second |
rejected_connections | Number of connections rejected due to maxclients limit |
expired_keys | Total number of key expiration events |
evicted_keys | The number of keys evicted due to maxmemory limit |
keyspace_hits | The number of times the key was successfully found in the main dictionary |
keyspace_misses | Number of failed key lookups in the main dictionary |
pubsub_channels | Owning client Number of global pub/sub channels subscribed |
pubsub_patterns | Number of global pub/sub patterns subscribed by the client |
latest_fork_usec | The duration of the latest fork operation, in microseconds |
info replication
The following is All replication related information:
Parameter name | Meaning |
---|---|
role | If the instance is not a slave node of any node, the value is "master", if the instance synchronizes data from a node, it is "slave". Note that a slave node can be the master of another slave node (daisy chain) |
If the instance is a slave node, these additional fields are provided:
Parameter name | Meaning |
---|---|
Host name or IP address of the master node | |
The TCP port the master node listens on | |
Connection status (up or down) | |
The number of seconds that have passed since the last interaction with the master node | |
Indicates that the master node is synchronizing with the slave node |
Parameter name | Meaning |
---|---|
The number of bytes remaining before synchronization is completed | |
Since the last time during a SYNC operation The number of seconds since the IO was transferred |
Parameter name | Meaning |
---|---|
The number of seconds that have elapsed since the connection was lost |
Meaning | |
---|---|
info CPU
The following is all cpu related information:
Meaning | |
---|---|
used_cpu_user | |
used_cpu_sys_children | |
used_cpu_user_children | |
info cluster
The cluster section currently contains only one unique field:
##Meaning | ##cluster_enabled |
---|---|
The keyspace section provides information about each Statistics of the main dictionary of the database. The statistical information is the total number of keys and the total number of expired keys. For each database, provide the following lines:
Parameter name
keyspace | |
---|---|
For more programming-related knowledge, please visit : Programming Video! ! |
The above is the detailed content of In-depth analysis of the Info command in Redis. For more information, please follow other related articles on the PHP Chinese website!

Redis是现在最热门的key-value数据库,Redis的最大特点是key-value存储所带来的简单和高性能;相较于MongoDB和Redis,晚一年发布的ES可能知名度要低一些,ES的特点是搜索,ES是围绕搜索设计的。

本篇文章给大家带来了关于redis的相关知识,其中主要介绍了关于redis的一些优势和特点,Redis 是一个开源的使用ANSI C语言编写、遵守 BSD 协议、支持网络、可基于内存、分布式存储数据库,下面一起来看一下,希望对大家有帮助。

本篇文章给大家带来了关于redis的相关知识,其中主要介绍了Redis Cluster集群收缩主从节点的相关问题,包括了Cluster集群收缩概念、将6390主节点从集群中收缩、验证数据迁移过程是否导致数据异常等,希望对大家有帮助。

本篇文章给大家带来了关于redis的相关知识,其中主要介绍了Redis实现排行榜及相同积分按时间排序,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,希望对大家有帮助。

本篇文章给大家带来了关于redis的相关知识,其中主要介绍了关于原子操作中命令原子性的相关问题,包括了处理并发的方案、编程模型、多IO线程以及单命令的相关内容,下面一起看一下,希望对大家有帮助。

本篇文章给大家带来了关于redis的相关知识,其中主要介绍了bitmap问题,Redis 为我们提供了位图这一数据结构,位图数据结构其实并不是一个全新的玩意,我们可以简单的认为就是个数组,只是里面的内容只能为0或1而已,希望对大家有帮助。

本篇文章给大家带来了关于redis的相关知识,其中主要介绍了Redis实现排行榜及相同积分按时间排序,本文通过实例代码给大家介绍的非常详细,下面一起来看一下,希望对大家有帮助。

本篇文章给大家带来了关于redis的相关知识,其中主要介绍了关于实现秒杀的相关内容,包括了秒杀逻辑、存在的链接超时、超卖和库存遗留的问题,下面一起来看一下,希望对大家有帮助。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
