View Redis memory usage under Linux

Source: Internet
Author: User
Tags readable redis cluster redis server

Connect a Redis server with a client:./redis-cli-h IP:p ORT

>>info

  • Server : General Redis Server information that contains the following domains:

    • redis_version : Redis Server version
    • redis_git_sha1 : Git SHA1
    • redis_git_dirty : Git dirty flag
    • OS : Host operating system for Redis server
    • arch_bits : Architecture (32 or 64 bit)
    • Multiplexing_api : The event handling mechanism used by Redis
    • gcc_version : The GCC version used when compiling Redis
    • process_id : PID of the server process
    • run_id : Random identifiers for Redis servers (for Sentinel and cluster)
    • tcp_port : TCP/IP Listening port
    • uptime_in_seconds : Number of seconds since the Redis server was started
    • uptime_in_days : The number of days elapsed since the Redis server was started
    • lru_clock : Self-increasing clock in minutes for LRU management
  • clients : Connected client information, including 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)
  • Memory: Ram information that contains the following fields:

    • 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 .
    • used_memory_peak : Peak memory consumption (in bytes) for Redis
    • Used_memory_peak_human : Returns the peak memory consumption of Redis in a human-readable format
    • Used_memory_lua : The amount of memory (in bytes) used by the LUA engine
    • Mem_fragmentation_ratio : ratio betweenused_memory_rss and used_memory
    • mem_allocator : Specified at compile time, the memory allocator used by Redis. It can be libc, Jemalloc, or Tcmalloc.
    Under ideal circumstances, Used_memory_rssshould only be compared to the value of used_memoryA little bit taller. When RSS > used , and the values of the two differ significantly, indicating the presence (internal or external) memory fragmentation. The ratio of memory fragmentation can be achieved by Mem_fragmentation_ratioof the value. When used > rss , it 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 has control over how it allocations is 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 the memory to the operating system, then used_memorymay not be consistent with the Redis memory footprint displayed by the operating system. View Used_memory_peakValue to verify that the condition occurs.
  • Persistence : Information aboutRDB and AOF

  • Stats : General statistical information

  • replication : master/Slave replication information

  • CPU : CPU COMPUTE statistics

  • commandstats : Redis Command statistics

  • cluster : Redis cluster information

  • keyspace : Database-related statistics

In addition to the values given above, the parameters 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.

View Redis memory usage under Linux

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.