• notice
  • Congratulations on the launch of the Sought Tech site

View Redis information and status

After redis-cli connects to the server, use the info command to view Redis information and status:

info1

The memory section shows the memory usage status of redis.


INFO [section]

Returns various information and statistics about the Redis server in a parseable and human-readable format.

By giving optional parameters section, you can make the command return only a certain part of the information:

  • serverThe section records information about the Redis server, which contains the following fields:

    • redis_version: Redis server version

    • redis_git_sha1: Git SHA1

    • redis_git_dirty : Git dirty flag

    • os: The host operating system of the Redis server

    • arch_bits: architecture (32 or 64 bit)

    • multiplexing_api: The event processing mechanism used by Redis

    • gcc_version: GCC version used when compiling Redis

    • process_id: PID of the server process

    • run_id: Random identifier for the Redis server (used for Sentinel and clusters)

    • tcp_port: TCP/IP listening port

    • uptime_in_seconds: the number of seconds elapsed since the Redis server was started

    • uptime_in_days: number of days elapsed since the Redis server was started

    • lru_clock: Clock incremented in minutes, used for LRU management

  • clientsThe section records information about connected clients and contains the following fields:

    • connected_clients: the number of connected clients (excluding clients connecting through slave servers)

    • client_longest_output_list: Among the currently connected clients, the longest output list

    • client_longest_input_buf: Among the currently connected clients, the maximum input buffer

    • blocked_clients: number of clients waiting for blocking commands (BLPOP, BRPOP, BRPOPLPUSH)

  • memoryThe section records server memory information and contains the following fields: Ideally, used_memory_rssthe value of should be only used_memoryslightly . When rss > used, and the values of the two differ greatly, it means that there is (internal or external) memory fragmentation. The ratio of memory fragmentation can be seen by mem_fragmentation_ratiothe value of . At that used > rsstime , it means that part of the Redis memory has been swapped out to the swap space by the operating system. In this case, the operation may cause significant delay. Because Redis does not have control over how its allocations are mapped to memory pages, high used_memory_rssis 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 releases the memory but does not return the memory to the operating system, used_memorythe value of may be inconsistent with the Redis memory usage displayed by the operating system. You can verify that this is happening by looking used_memory_peakat the value of .

    • used_memory: The total amount of memory allocated by the Redis allocator, in bytes

    • used_memory_human: Returns the total amount of memory allocated by Redis in human readable format

    • used_memory_rss: From the perspective of the operating system, returns the total amount of memory allocated by Redis (commonly known as the resident set size). This value is consistent with the output of the top, , psetc. commands.

    • used_memory_peak: peak memory consumption of Redis in bytes

    • used_memory_peak_human: Returns the peak memory consumption of Redis in a human readable format

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

    • mem_fragmentation_ratio: the ratio betweenused_memory_rssused_memory

    • mem_allocator: The memory allocator used by Redis, specified at compile time. Can be libc, jemalloc or tcmalloc.

  • persistenceThe section records information related to RDBpersistence and AOFpersistence, and it contains the following fields: If the AOF persistence function is enabled, this section will also add 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 started or after the last execution of AOF rewrite.

    • aof_pending_rewrite: A flag value that records whether there is an AOF rewrite operation to be performed after waiting for the RDB file to be created.

    • aof_buffer_length: The size of the AOF buffer.

    • aof_rewrite_buffer_length: The size of the AOF rewrite buffer.

    • aof_pending_bio_fsync: The number of fsynccalls .

    • aof_delayed_fsync: The number of fsynccalls .

    • loading: A flag value that records whether the server is loading the persistent file.

    • rdb_changes_since_last_save: How many seconds have elapsed since the last successful creation of a persistent 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 last successful creation of the RDB file.

    • rdb_last_bgsave_status: A flag value that records whether the result of the latest RDB file creation was successful or failed.

    • rdb_last_bgsave_time_sec: Records the number of seconds it took to create the RDB file last time.

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

    • aof_rewrite_in_progress: A flag value that records whether the server is creating an AOF file.

    • aof_rewrite_scheduled: A flag value that records whether to perform scheduled AOF rewriting operations after the RDB file is created.

    • aof_last_rewrite_time_sec: The last time it took to create an AOF file.

    • aof_current_rewrite_time_sec: If the server is creating an AOF file, then this field records the number of seconds that the current creation operation has taken.

    • aof_last_bgrewrite_status: A flag value, which records whether the result of creating the AOF file last time was successful or failed.

  • statssection records general statistics and contains the following fields:

    • total_connections_received: The number of connection requests accepted by the server.

    • total_commands_processed: The number of commands the server has executed.

    • instantaneous_ops_per_sec: The number of commands executed by the server per second.

    • rejected_connections: The number of connection requests rejected due to the limit on the maximum number of clients.

    • expired_keys: The number of database keys that were automatically deleted due to expiration .

    • evicted_keys: The number of keys that were evicted due to the maximum memory size limit.

    • keyspace_hits: The number of times the database key was successfully looked up.

    • keyspace_misses: Number of failed lookups for database keys.

    • pubsub_channels: The number of channels currently subscribed to.

    • pubsub_patterns: The number of schemas currently subscribed to.

    • latest_fork_usec: The number of milliseconds the last fork()operation took.

  • replication: Master/slave replication information If the current server is a slave server, the following fields will be added to this part: If the synchronization operation is in progress, the following fields will be added to this part: If the connection between the master and slave servers is in disconnected state, then this section will also add the following fields: Here are some fields that will always appear: For each slave server, the following line of information will be added:

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

    • connected_slaves: The number of connected slave servers.

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

    • master_sync_left_bytes: How many bytes of data are missing until the synchronization is complete.

    • master_sync_last_io_seconds_ago: How many seconds have elapsed since the last I/O due to a SYNC operation.

    • master_host: The IP address of the master server.

    • master_port: The TCP listening port number of the master server.

    • master_link_status: The current status of the replication connection, upindicating that the connection is normal, downindicating that the connection is disconnected.

    • 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: The value of this field is if the current server is not replicating any other servers master; otherwise, the value of this field is slave. Note that when creating a replication chain, a slave server may also be the master server of another server.

  • cpuThe section records CPU computation statistics and contains the following fields:

    • used_cpu_sys: System CPU consumed by the Redis server.

    • used_cpu_user: User CPU consumed by the Redis server.

    • used_cpu_sys_children: System CPU consumed by background processes.

    • used_cpu_user_children: User CPU consumed by background processes.

  • commandstatsThe section records the execution statistics of various types of commands, such as the number of command executions, the CPU time spent by the command, 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

  • clusterThe section records information related to the cluster, which contains the following fields:

    • cluster_enabled: A flag value that records whether the cluster function has been enabled.

  • keyspaceSome statistics related to the database are recorded, such as the number of keys in the database, the number of expired keys that have been deleted from the database, 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 sectionparameter can have the following two values:

  • all: return all information

  • default: return the information selected by default

When the INFO command defaultis invoked directly without arguments , use as default argument.

Different versions of Redis may have added or deleted some of the fields returned.

Therefore, when a robust client program analyzes the output of the INFO command, it should be able to skip unrecognized fields and properly handle missing missing fields.


Tags

Technical otaku

Sought technology together

Related Topic

1 Comments

author

cheap lipitor & lt;a href="https://lipiws.top/"& gt;atorvastatin 20mg pills& lt;/a& gt; order atorvastatin 80mg online

Mpnzru

2024-03-09

Leave a Reply

+