Redis Status and information viewing

Source: Internet
Author: User
Tags redis server

Transferred from: http://my.oschina.net/tongyufu/blog/405612

REDIS-CLI after connecting to the server, use the Info command to view redis information and Status:

INFO [Section]

Returns a variety of information and statistics about Redis servers in an easy-to-interpret (parse) and easy-to-read format.

Given optional parameters section , you can have the command return only a portion of the information:

  • serverSection records information about the Redis server, which contains the following domains:

      • redis_version  : Redis Server version

      • redis_git_sha1  : git SHA1

      • redis_git_dirty  : Git dirty flag

      • os  : Redis Server host operating system

      • arch_bits  : schema (32 or 64 bit)

      • multiplexing_api &NBSP: The event handling mechanism used by Redis

      • gcc_version  : gcc version used when compiling Redis

      • PR ocess_id  : PID of server process

      • run_id  : Random identifier for Redis server (for Sentinel and cluster)

      • tcp_port  : TCP/IP Listener port

      • uptime_in_seconds  : self-Redis Number of seconds elapsed since the server started

      • uptime_in_days  : Number of days since the Redis server started

      • lru_ Clock  : Self-increasing clocks in minutes for LRU management

  • clientsSection records information about a connected client that 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 output in the currently connected 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)

  • memory   Partially records the server's RAM information, which contains the following domains:

    In the ideal case,   used_memory_rss   should be a value that is only greater than   used_memory   A little bit taller.

    When  , rss > used  , and the values of the two differ significantly, there is a memory fragmentation (internal or external). The ratio of

    Memory fragments can be seen by the value of   mem_fragmentation_ratio  .

    When  , used > rss  , indicates that part of Redis's memory has been swapped out into swap space by the operating system, in which case the operation can have a noticeable delay.

    because Redis does not having control over how it allocations is mapped to memory PA GES, High used_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, then   used_memory   may not match the Redis memory footprint displayed by the operating system.

    View   used_memory_peak   value To verify that this occurs.

      • 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  : From the operating system's perspective, return to Redis Total amount of memory allocated (commonly known as resident set size). This value is identical to the output of the  , top  ,  , PS , and so on.

      • used_memory_peak  : Peak memory consumption (in bytes) for Redis

      • used_memory_peak _human  : Returns the peak memory consumption of Redis in human-readable format

      • used_memory_lua  : Lua The memory size (in bytes) used by the engine

      • mem_fragmentation_ratio  :  Used_memory_rss   and   used_memory   ratio

      • mem_allocator  : The memory allocator used by Redis, as specified at compile time. It can be libc, Jemalloc, or Tcmalloc.

  • persistenceSection Records RDB AOF information about persistence and persistence, which contains the following fields:

    If the AOF persistence feature is turned on, this section also adds the following fields:

    • aof_current_size: The current size of the 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 has been created.

    • aof_buffer_length: The size of the AOF buffer.

    • aof_rewrite_buffer_length: AOF the size of the rewrite buffer.

    • aof_pending_bio_fsync: The number of calls waiting to be executed inside the background I/O queue fsync .

    • aof_delayed_fsync: The number of calls that were delayed fsync .

    • loading: A flag value that records whether the server is loading persisted files.

    • rdb_changes_since_last_save: How many seconds elapsed since the last successful creation of the persistence file.

    • 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 an RDB file.

    • rdb_last_bgsave_status: A flag value that records whether the result of the most recent RDB file creation was successful 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 the 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 is required to perform an appointment after the RDB file has been created.

    • aof_last_rewrite_time_sec: The last time the AOF file was 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.

  • statsSection 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  : Number of commands executed per second by the server.

      • rejected_connections  : The number of connection requests 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 has been successfully found.

      • keyspace_misses  : The number of times the database key failed to find.

      • pubsub_channels  : Number of channels currently subscribed.

      • pubsub_patterns  : Number of modes currently subscribed.

      • latest_fork_usec  : most recent   fork ()   The number of milliseconds that the operation is consuming.

  • replication: Master/Slave replication information

    If the current server is a slave server, then this section will also add the following fields:

    If the synchronization operation is in progress, this section also adds the following fields:

    If the connection between the master and slave servers is in a disconnected state, this section also adds the following fields:

    Here are some of the fields that always appear:

    For each slave server, add the following line of information:

    • slaveXXX: ID, IP address, port number, connection status

    • connected_slaves: Number of connected slave servers.

    • master_link_down_since_seconds: How many seconds the master-slave server connection was disconnected.

    • 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.

    • master_host: The IP address of the primary server.

    • master_port: The TCP listener port number for the primary server.

    • master_link_status: The current state of the replication connection indicates that the connection is up normal and that the down 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 master server is synchronizing with this slave server.

    • 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.

  • cpuThe calculated statistics for the CPU are partially recorded, which contains the following fields:

      • used_cpu_sys: The system CPU consumed by the Redis server.

      • used_cpu_user: The user CPU consumed by the Redis 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.

  • commandstatsThis section records the 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

  • clusterSection records information about the cluster, which contains the following domains:

      • cluster_enabled: A flag value that records whether the cluster function is turned on.

  • keyspaceSome database related statistics are recorded, 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 the values given above, the section value of the parameter can be two of the following:

    • all: Returns all information

    • default: Returns the information selected by default

When the INFO command is called directly without parameters, it is used default as the default 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.

  • Available versions:

  • >= 1.0.0

  • Complexity of Time:

  • O (1)

  • return value:

  • See test code below for details.

    1 # Server2Redis_version:2.8.43REDIS_GIT_SHA1:000000004Redis_git_dirty:05 Redis_build_id:8f6097d7914679ca6 Redis_mode:standalone7Os:linux3.13.0-Panax Notoginseng-generic i6868Arch_bits: +9 Multiplexing_api:epollTenGcc_version:4.8.2 OnePROCESS_ID:1380 A run_id:c57b3c410a00d9a7ee3b2cf9eb72479d8097f328 -Tcp_port:6379 -Uptime_in_seconds:30905 theUptime_in_days:0 -Hz:Ten -Lru_clock:520960 -config_file:/etc/redis/redis.conf +  - # Clients +Connected_clients:1 AClient_longest_output_list:0 atCLIENT_BIGGEST_INPUT_BUF:0 -Blocked_clients:0 -  - # Memory -Used_memory:423880 -Used_memory_human:413. 95K inUsed_memory_rss:7495680 -Used_memory_peak:386096 toUsed_memory_peak_human:377. 05K +Used_memory_lua:22528 -Mem_fragmentation_ratio:17.68 themem_allocator:jemalloc-3.4.1 *  $ # PersistencePanax NotoginsengLoading0 -Rdb_changes_since_last_save:0 theRdb_bgsave_in_progress:0 +Rdb_last_save_time:1452244404 A Rdb_last_bgsave_status:ok theRdb_last_bgsave_time_sec:0 +rdb_current_bgsave_time_sec:-1 -Aof_enabled:0 $Aof_rewrite_in_progress:0 $Aof_rewrite_scheduled:0 -aof_last_rewrite_time_sec:-1 -aof_current_rewrite_time_sec:-1 the Aof_last_bgrewrite_status:ok - Wuyi # Stats theTotal_connections_received:3 -Total_commands_processed:2 WuInstantaneous_ops_per_sec:0 -Rejected_connections:0 AboutSync_full:0 $SYNC_PARTIAL_OK:0 -Sync_partial_err:0 -Expired_keys:0 -Evicted_keys:0 AKeyspace_hits:1 +Keyspace_misses:0 thePubsub_channels:0 -Pubsub_patterns:0 $Latest_fork_usec:984 the  the # Replication the Role:master theConnected_slaves:0 -Master_repl_offset:0 inRepl_backlog_active:0 theRepl_backlog_size:1048576 theRepl_backlog_first_byte_offset:0 AboutRepl_backlog_histlen:0 the  the # CPU theUsed_cpu_sys:2.31 +Used_cpu_user:3.26 -Used_cpu_sys_children:0.00 theUsed_cpu_user_children:0.00Bayi  the # Keyspace thedb0:keys=1, expires=0, avg_ttl=0

Redis Status and information viewing

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.