Detailed explanation of redis info (InsCode AI creation assistant)

redis info detailed explanation

Option description:

Redis INFOcommands return various information and statistics about the Redis server, which can help you monitor and manage Redis instances. INFOThe output of the command is a string containing multiple lines of text, including various information categories. INFOHere is the information contained in some common command output:

  1. Server : This section contains basic information about the Redis server, such as Redis version, operating mode, server ID, port number, process ID, etc.
  2. Clients : This section contains information about the clients connected to the Redis server, such as the number of connections, the maximum number of connections, the number of blocked clients, etc.
  3. Memory : This section provides information about Redis memory usage, including used memory, memory peak, memory fragmentation rate, memory allocator, etc.
  4. Persistence : This section contains information about Redis persistence, such as RDB snapshots, AOF files, replication and master-slave information, etc.
  5. Stats : This section contains various statistical data, such as key space information, command statistics, time statistics, etc.
  6. Replication : If the Redis server is a master node, this section provides information about master-slave replication, including the number of connected slave nodes, master-slave synchronization status, etc.
  7. CPU : Provides information about the CPU usage of the Redis server, including CPU usage, CPU consumption of various commands, etc.
  8. Cluster : If the Redis server is a cluster node, this section provides information about the cluster, such as cluster status, sharding information, etc.
  9. Keyspace : This section lists the statistics of keys in various Redis databases (DB), including the number of keys, the number of expired keys, etc.
  10. Commandstats : Provides execution statistics about various Redis commands, including the number of executions of the command, execution time, etc.
  11. Sentinel : If the Redis server is a Sentinel instance, this section provides Sentinel status information.

Note that INFOthe output of the command is very verbose and contains a lot of information. You can use different information categories to find information that interests you in order to monitor the performance and status of your Redis server.

To get specific information, you can use INFOarguments to the command, for example:

INFO memory

This will only return memory related information. Different versions of Redis may provide different information and statistics, so it is recommended to check the official documentation of the version of Redis you are using for more detailed information. Additionally, monitoring tools and third-party tools can be used to visualize and analyze INFOthe output of commands to better understand the performance of the Redis server.

specific explanation

Server : Provides basic information about the Redis server.

  • redis_version: The version number of the Redis server.
  • redis_git_sha1: If Redis was built from Git source, this field will display Git's SHA1 commit hash.
  • redis_git_dirty: If there are uncommitted changes in the Redis Git repository, this field is 1; otherwise, it is 0.
  • os: The operating system the Redis server runs.
  • arch_bits: The number of bits of the operating system (for example, 32-bit or 64-bit).
  • multiplexing_api: The multiplexing API used by Redis, usually "epoll" (Linux), "kqueue" (BSD) or "select".
  • atomicvar_api: Atomic variable API used by Redis.
  • gcc_version: The version number of the GCC compiler used to build Redis.
  • process_id: The process ID of the Redis server.
  • run_id: The unique identifier of the Redis server, usually used in Redis clusters.
  • tcp_port: TCP port number that the Redis server listens to.
  • uptime_in_seconds: The total number of seconds the Redis server has been running.
  • uptime_in_days: The total number of days the Redis server has been running.
  • hz: The heartbeats per second of the Redis server (usually 10).
  • configured_hz: The heartbeat per second configured by the Redis server (usually the same as "hz").
  • lru_clock: LRU clock, used for elimination algorithm.
  • executable: The executable file path of the Redis server.
  • config_file: The configuration file path of the Redis server.

Clients : Provides information about clients connected to the Redis server.

  • connected_clients: The number of clients currently connected to the Redis server.
  • client_longest_output_list: The length of the client's output list in the longest output list (i.e., the response buffer).
  • client_longest_input_buf: The length of the client's input buffer in the longest input buffer.
  • blocked_clients: The number of clients blocked waiting for some operation.

Memory : Provides information about Redis memory usage.

  • used_memory: The total amount of memory currently occupied by the Redis server.
  • used_memory_human: Display memory usage in human-readable form.
  • used_memory_rss: The actual memory usage of the Redis process (Resident Set Size).
  • used_memory_peak: The maximum amount of memory occupied by the Redis server in history.
  • used_memory_peak_human: Displays memory peaks in a human-readable format.
  • used_memory_lua: The memory occupied by the Lua script engine.
  • used_memory_lua_human: Displays the memory occupied by the Lua script engine in human-readable form.

Persistence : Contains information about Redis persistence.

  • loading: If Redis is loading persistent data, this field will display "1", otherwise it will be "0".
  • rdb_changes_since_last_save: The number of changes since the last RDB snapshot.
  • rdb_bgsave_in_progress: If Redis is performing an RDB snapshot operation, this field will display "1", otherwise it will be "0".
  • rdb_last_save_time: The timestamp of the last successful RDB snapshot execution.
  • rdb_last_bgsave_status: The status of the last RDB snapshot ("ok" for success, "err" for failure).
  • rdb_last_bgsave_time_sec: The time (seconds) spent on the last RDB snapshot operation.
  • rdb_current_bgsave_time_sec: The time (seconds) that the currently ongoing RDB snapshot operation has been running.
  • aof_enabled: If AOF (Append-Only File) persistence is enabled, this field will display "1", otherwise it will be "0".
  • aof_rewrite_in_progress: If Redis is performing an AOF rewrite operation, this field will display "1", otherwise it will be "0".
  • aof_rewrite_scheduled: If Redis has scheduled an AOF rewrite operation, this field will display "1", otherwise it will be "0".
  • aof_last_rewrite_time_sec: The time (seconds) spent on the last AOF rewrite operation.
  • aof_current_rewrite_time_sec: The time (seconds) that the currently ongoing AOF rewrite operation has been running.

Stats : Provides various statistical data, including key space information, command statistics, time statistics, etc.

  • total_connections_received: The total number of connections accepted by the Redis server.
  • total_commands_processed: The total number of commands executed by the Redis server.
  • instantaneous_ops_per_sec: The current number of commands executed per second.
  • total_net_input_bytes: The total number of bytes received by the Redis server from the client.
  • total_net_output_bytes: The total number of bytes sent by the Redis server to the client.
  • instantaneous_input_kbps: The current received network data rate per second (KB/s).
  • instantaneous_output_kbps: The current network data rate sent per second (KB/s).

Replication : If the Redis server is a master node, provides information about master-slave replication.

  • role: The role of the Redis server (master or slave).
  • connected_slaves: Number of slave nodes connected to the master node.
  • master_replid: The replication ID of the primary node.
  • master_replid2: The replication ID of the primary node (secondary replication ID).
  • master_repl_offset: Offset copied from primary node.
  • second_repl_offset: Auxiliary offset (the offset copied from the node).
  • repl_backlog_active: This field will display "1" if the master node has replication backlog buffer enabled, otherwise it will be "0".
  • repl_backlog_size: Size of the copy backlog buffer.
  • repl_backlog_first_byte_offset: Offset of the first byte of the backlog buffer to be copied.
  • repl_backlog_histlen: The historical length of the copy backlog buffer.

CPU : Provides information about Redis server CPU usage.

  • used_cpu_sys: The total CPU time (seconds) of the Redis server running in the kernel mode.
  • used_cpu_user: The total CPU time (seconds) of the Redis server running in user mode.
  • used_cpu_sys_children: Total CPU time (seconds) spent by the Redis child process running in the kernel state.
  • used_cpu_user_children: Total CPU time (seconds) spent by the Redis subprocess running in user mode.

Cluster : If the Redis server is a cluster node, provides information about the cluster.

  • cluster_enabled: If the Redis server is a cluster node, this field will display "1", otherwise it will be "0".

Keyspace : Lists statistics for keys in various Redis databases (DB).

  • Each DB has similar key statistical fields, such as db0, db1etc. These fields include the number of keys, the number of expired keys, etc.

Commandstats : Provides execution statistics about various Redis commands.

  • Each Redis command has a field such as cmdstat_get, cmdstat_setetc. These fields include the number of executions of the command, execution time, etc.

Sentinel : If the Redis server is a Sentinel instance, provides status information about Sentinel.

  • sentinel_masters: Number of master nodes monitored by Sentinel.
  • sentinel_tilt: If Sentinel is disabled due to some problem, this field will display "1", otherwise it will be "0".

Please note that the specific field names and information may vary slightly depending on different Redis versions and configurations. You can use INFOcommands to view details on a specific Redis server.

Guess you like

Origin blog.csdn.net/LSW1737554365/article/details/132853904