View Redis information and status

Source: Internet
Author: User
Tags redis server

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

Info

Where the memory segment shows the state of the Redis's RAM usage.



The following content is copied 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 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

      • p rocess_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  : From Redis service The number of seconds elapsed since the server was started

      • uptime_in_days  : Number of days since Redis servers 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 p Ages, 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.

redis> info# serverredis_version:2.9.11redis_git_sha1:937384d0redis_git_dirty:0redis_build_id : 8e9509442863f22redis_mode:standaloneos:linux 3.13.0-35-generic x86_64arch_bits:64multiplexing_api: Epollgcc_version:4.8.2process_id:4716run_id:26186aac3f2380aaee9eef21cc50aecd542d97dctcp_port:6379uptime_in_ Seconds:362uptime_in_days:0hz:10lru_clock:1725349config_file:# clientsconnected_clients:1client_longest_ Output_list:0client_biggest_input_buf:0blocked_clients:0# memoryused_memory:508536used_memory_human : 496.62kused_memory_rss:7974912used_memory_peak:508536used_memory_peak_human:496.62kused_memory_lua:33792mem_ Fragmentation_ratio:15.68mem_allocator:jemalloc-3.2.0# persistenceloading:0rdb_changes_since_last_save : 6rdb_bgsave_in_progress:0rdb_last_save_time:1411011131rdb_last_bgsave_status:okrdb_last_bgsave_time_sec:-1rdb _current_bgsave_time_sec:-1aof_enabled:0aof_rewrite_in_progress:0aof_rewrite_scheduled:0aof_last_rewrite_time_ Sec:-1aof_current_rewrite_timE_sec:-1aof_last_bgrewrite_status:okaof_last_write_status:ok# statstotal_connections_received:2total_ Commands_processed:4instantaneous_ops_per_sec:0rejected_connections:0sync_full:0sync_partial_ok:0sync_partial_ Err:0expired_keys:0evicted_keys:0keyspace_hits:0keyspace_misses:0pubsub_channels:0pubsub_patterns:0latest_fork _usec:0migrate_cached_sockets:0# replicationrole:masterconnected_slaves:0master_repl_offset:0repl_backlog _active:0repl_backlog_size:1048576repl_backlog_first_byte_offset:0repl_backlog_histlen:0# cpuused_cpu_sys : 0.21used_cpu_user:0.17used_cpu_sys_children:0.00used_cpu_user_children:0.00# clustercluster_enabled:0#  keyspacedb0:keys=2,expires=0,avg_ttl=0


View Redis information and status

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.