Translated from: http://redisdoc.com/server/info.html
INFO [Section]
Returns a variety of information and statistics about Redis servers in an easy-to-interpret (parse) and easy-to-read format.
Given an optional parameter section, you can have the command return only a portion of the information:
- The
-
server section records information about the Redis server, which contains the following domains:
- redis_version& nbsp: Redis Server version
- redis_git_sha1 : Git SHA1
- redis_git_dirty : Git dirty flag
OS&NBSP: The host operating system of the Redis server
- arch_bits : schema (32 or 64 bit)
- multiplexing_api : event handling used by Redis Mechanism
- GCC_VERSION&NBSP: The GCC version used to compile Redis
- process_id : PID of the server process
- run_id : Random identifiers for Redis servers (for Sentinel and cluster)
- tcp_port : TCP/IP Listener port
- uptime_in_seconds : from Redis server Number of seconds since startup
- uptime_in_days : The number of days elapsed since the Redis server started
- lru_clock : Self-increasing clocks in minutes for LRU management
The Clients section records information about the connected client, which contains the following domains:
- Connected_clients: Number of connected clients (not including clients connected through a secondary server)
- Client_longest_output_list: The longest list of outputs currently connected to the client
- CLIENT_LONGEST_INPUT_BUF: The maximum input cache for the currently connected client
- Blocked_clients: Number of clients waiting for the blocking command (Blpop, Brpop, Brpoplpush)
The memory section records information about the server, which contains the following domains:
- Used_memory: Total amount of memory allocated by the Redis allocator, in bytes (byte)
- Used_memory_human: Returns the total amount of memory allocated by Redis in human-readable format
- Used_memory_rss: Returns the total amount of memory allocated by Redis (commonly known as the resident set size) from the operating system's perspective. This value is consistent with the output of commands such as top and PS.
- Peak memory consumption (in bytes) of the Used_memory_peak:redis
- Used_memory_peak_human: Returns the peak memory consumption of Redis in a human-readable format
- The memory size (in bytes) used by the Used_memory_lua:lua engine
- Ratio between Mem_fragmentation_ratio:used_memory_rss and used_memory
- Mem_allocator: Specified at compile time, the memory allocator used by Redis. It can be libc, Jemalloc, or Tcmalloc.
Ideally, the value of the Used_memory_rss should be only slightly higher than the used_memory. When RSS > used, and the difference between the two values, indicates the existence (internal or external) memory fragmentation. The rate of memory fragmentation can be seen through the Mem_fragmentation_ratio value. When used > rss, it means that part of Redis's memory is swapped out to swap space, in which case the operation can have a noticeable delay.
Because Redis does not has control over how it allocations be mapped to memory pages, Highused_memory_rss is often the Result of a spike in memory usage.
When Redis frees memory, the allocator may or may not, return memory to the operating system. If Redis frees up memory and does not return memory to the operating system, the value of used_memory may not be consistent with the Redis memory footprint displayed by the operating system. Review the value of Used_memory_peak to verify that this is happening.
The persistence section records information about the RDB persistence and AOF persistence, which contains the following domains:
- loading : A flag value that records whether the server is loading the persisted file.
- rdb_changes_since_last_save : How many seconds elapsed since the last time the persisted file was successfully created.
- rdb_bgsave_in_progress : A flag value that records whether the server is creating an RDB file.
- rdb_last_save_time : The UNIX timestamp of the most recent successful creation of the Rdb file.
- rdb_last_bgsave_status : A flag value that records whether the result of the most recent RDB file creation succeeded or failed.
- rdb_last_bgsave_time_sec : Records the number of seconds spent in the last time an RDB file was created.
- rdb_current_bgsave_time_sec : If the server is creating an Rdb file, this field records the number of seconds that the current creation operation has taken.
- aof_enabled : A flag value that records whether AOF is open.
- aof_rewrite_in_progress : A flag value that records whether the server is creating a aof file.
- aof_rewrite_scheduled : A flag value that records whether an aof rewrite of the appointment needs to be performed after the RDB file has been created.
- aof_last_rewrite_time_sec : The amount of time the AoF file was last created.
- aof_current_rewrite_time_sec : If the server is creating a aof file, this field records the number of seconds that the current creation operation has taken.
- aof_last_bgrewrite_status : A flag value that records whether the result of the most recent creation of the AoF file succeeded or failed.
If the AOF persistence feature is turned on, this section also adds the following fields:
- The current size of the aof_current_size:aof file.
- Aof_base_size: The size of the AoF file when the server starts or AOF overrides the most recent execution.
- Aof_pending_rewrite: A flag value that records whether a aof rewrite operation is performed after the RDB file is created.
- The size of the aof_buffer_length:aof buffer.
- Aof_rewrite_buffer_length:aof the size of the rewrite buffer.
- Aof_pending_bio_fsync: The number of Fsync calls waiting to be executed inside the background I/O queue.
- Aof_delayed_fsync: The number of Fsync calls that are delayed.
The stats section Records general statistics, which contain the following fields:
- Total_connections_received: The number of connection requests that the server has accepted.
- Total_commands_processed: The number of commands that the server has executed.
- Instantaneous_ops_per_sec: The number of commands that the server executes per second.
- Rejected_connections: The number of connection requests that were rejected because of the maximum number of client limits.
- Expired_keys: The number of database keys that are automatically deleted because they expire.
- Evicted_keys: The number of keys evicted (evict) because of the maximum memory capacity limit.
- Keyspace_hits: The number of times the database key was found successfully.
- Keyspace_misses: The number of times the database key failed to find.
- Pubsub_channels: The number of channels currently subscribed to.
- Pubsub_patterns: The number of modes currently subscribed to.
- Latest_fork_usec: The number of milliseconds spent in the most recent fork () operation.
Replication: master/Slave replication information
- Role: If the current server is not replicating any other server, then the value of this domain is master; otherwise, the value of this field is slave. Note that when you create a replication chain, a Slave server may also be the primary server for another server.
If the current server is a slave server, then this section will also add the following fields:
- Master_host: The IP address of the primary server.
- Master_port: TCP Listener port number for the primary server.
- Master_link_status: The current state of the replication connection, up indicates that the connection is normal, and down indicates that the connection is broken.
- Master_last_io_seconds_ago: How many seconds have elapsed since the last communication with the master server.
- Master_sync_in_progress: A flag value that records whether the primary server is synchronizing with this slave server.
If the synchronization operation is in progress, this section also adds the following fields:
- Master_sync_left_bytes: How much byte data is missing from synchronization completion.
- Master_sync_last_io_seconds_ago: How many seconds have elapsed since I/O was last due to sync operation.
If the connection between the master and slave servers is in a disconnected state, this section also adds the following fields:
- Master_link_down_since_seconds: How many seconds the master-slave server connection was disconnected.
Here are some of the fields that always appear:
- Connected_slaves: Number of connected slave servers.
For each slave server, add the following line of information:
- Slavexxx:id, IP address, port number, connection status
The CPU section records the CPU's computational statistics, which contain the following domains:
- Used_cpu_sys:redis the system CPU consumed by the server.
- Used_cpu_user:redis the user CPU consumed by the server.
- Used_cpu_sys_children: The system CPU consumed by the background process.
- Used_cpu_user_children: The user CPU consumed by the background process.
The Commandstats section records execution statistics for various types of commands, such as the number of command executions, the CPU time spent on commands, the average CPU time spent executing each command, and so on. For each type of command, this section adds a line of information in the following format:
- Cmdstat_xxx:calls=xxx,usec=xxx,usecpercall=xxx
The cluster section records information about the cluster, which contains the following domains:
- Cluster_enabled: A flag value that records whether the cluster function is turned on.
The Keyspace section records statistics related to the database, such as the number of keys in the database, the number of expired keys that the database has been deleted, and so on. For each database, this section adds a line of information in the following format:
- Dbxxx:keys=xxx,expires=xxx
In addition to these values given above, the value of the section parameter can be two of the following:
- All: Return all information
- Default: Returns the information that is selected
When the INFO command is called directly without parameters, default is used as the parameter.
Different versions of Redis may have added or truncated some of the returned domains.
Therefore, when analyzing the output of the INFO command, a robust client program should be able to skip domains that you do not know and handle the missing domains properly.
Http://blog.chinaunix.net/uid-28437434-id-5598490.html
View Redis information and status