Redis related operation instructions

1. Detailed explanation of redis info

127.0.0.1:6379> info all
# Server (server information)
redis_version: 3.0.0 #redis server version
redis_git_sha1: 00000000 #Git SHA1
redis_git_dirty: 0 #Git dirty flag
redis_build_id: 6c2c390b97607ff0 #redis build id
redis_mode: cluster #Run mode, Single machine or cluster
os: Linux 2.6.32-358.2.1.el6.x86_64 x86_64 #redis server host operating system
arch_bits: 64 #architecture (32 or 64 bit)
multiplexing_api: epoll #redis event handling mechanism
gcc_version: 4.4 .7
#gcc version used when compiling redis process_id: 12099 #pid of redis server process
run_id: 63bcd0e57adb695ff0bf873cf42d403ddbac1565 #random identifier of the redis server (used for sentinel and cluster)
tcp_port: 9021 #redis server listening port
uptime_in_seconds: 26157730 #redis server total startup time in seconds
uptime_in_days: 302 #redis server total startup time in units of Days
hz: 10 #redis internal scheduling (to close the timeout client, delete expired keys, etc.) frequency, the program stipulates that serverCron runs 10 times per second.
lru_clock: 14359959 #The self-increasing clock is used for LRU management. The clock is updated every 100ms (hz = 10, so every 1000ms / 10 = 100ms executes a timed task).
config_file: /redis_cluster/etc/9021.conf #Config file path

# Clients (connected client information)
connected_clients: 1081 #Number of connected clients (excluding clients connected via slave)
client_longest_output_list: 0 # Among the currently connected clients, the longest output list is observed with the client list command The maximum value of the omem field
client_biggest_input_buf: 0 # Among the currently connected clients, the maximum input cache, use the client list command to observe the qbuf and qbuf-free two fields maximum
blocked_clients: 0 # Waiting for blocking commands (BLPOP, BRPOP, BRPOPLPUSH) Number of clients

# Memory (memory information)
used_memory: 327494024 #Total amount of memory allocated by redis allocator, in bytes
used_memory_human: 312.32M #To return total amount of memory allocated by redis in human readable format
used_memory_rss: 587247616 #From the operating system From the perspective of, return the total amount of memory allocated by redis (commonly known as the size of the resident set). This value is consistent with the output of the top command used_memory_peak: 1866541112 # redis's
peak memory consumption (in bytes) 
used_memory_peak_human: 1.74G # redis's peak memory consumption in
red human-readable format used_memory_lua: 35840 #lua engine used Memory size (in bytes)
mem_fragmentation_ratio: 1.79 #The ratio between used_memory_rss and used_memory, less than 1 means the use of swap, greater than 1 means more fragmentation
mem_allocator: jemalloc-3.6.0 # used in redis specified at compile time Memory allocator. Can be libc, jemalloc or tcmalloc

# Persistence (Relevant information about the persistence of the RDB and AOF)
loading: 0 # Whether the server is loading the persistence file
rdb_changes_since_last_save: 28900855 #The last successful generation of the RDB file, the number of write commands, that is, how many write commands No persistent
rdb_bgsave_in_progress: 0 # Whether the server is creating an
RDB file rdb_last_save_time: 1482358115 # The timestamp from the last successful RDB file creation. Current timestamp-rdb_last_save_time = How many seconds did not generate the
RDB file successfully rdb_last_bgsave_status: ok #Whether the last rdb persistence was successful
rdb_last_bgsave_time_sec: 2 #The last successful generation of the
RDB file took time seconds rdb_current_bgsave_time_sec: -1 #If the server is creating the RDB file Then this field records the number of seconds that the current create operation has taken
aof_enabled: 1 #Whether
aof aof_rewrite_in_progress: 0 is turned on #Identifies whether the rewrite operation of
aof is in progress aof_rewrite_scheduled: 0              
#rewrite task plan, when the client sends the bgrewriteaof instruction, if the current rewrite subprocess is being executed, then the client requested bgrewriteaof will be changed to a scheduled task, and the rewrite will be executed after the end of the 
aof subprocess aof_last_rewrite_time_sec: -1 #The latest aof rewrite cost The duration of
aof_current_rewrite_time_sec: -1 #If the rewrite operation is in progress, record the time used, in seconds
aof_last_bgrewrite_status: ok #Last bgrewriteaof operation status
aof_last_write_status: ok #Last aof write status
aof_current_size: 4201740 #aof current size
aof_base_size : 4201687 #At server startup or after aof rewriting the size of the
aof file after the last execution
aof_pending_rewrite: 0 #Is there any aof rewriting operation to be performed after waiting for the creation of the RDB file? Aof_buffer_length: 0 #aof buffer size
aof_rewrite_buffer_length: 0 #aof Rewrite buffer size
aof_pending_bio_fsync: 0 #Number of fsync calls waiting to be executed in the background I / O queue
aof_delayed_fsync: 0 #Number of delayed fsync calls

# Stats (general statistical information)
total_connections_received: 209561105 #The number of newly created connections, if there are too many newly created connections, excessively creating and destroying connections will have an impact on performance, indicating that the short connection is serious or the connection pool is in use, and the code needs to be investigated. Connection settings
total_commands_processed: 2220123478 #redis processed commands
instantaneous_ops_per_sec: 279 #redis current qps, redis internal real-time commands executed per second
total_net_input_bytes: 118515678789 #redis network ingress traffic bytes
total_net_output_bytes: 236361651271 #redis network egress traffic Number of bytes
instantaneous_input_kbps: 13.56 #redis network entrance kps
instantaneous_output_kbps: 31.33 #redis network exit kps
rejected_connections: 0 #Number of connections rejected, number of redis connections reached maxclients limit, number of new connections rejected
sync_full: 1 # Master-slave complete Number of successful synchronizations
sync_partial_ok: 0 #Number of master-slave partial synchronization success
sync_partial_err: 0 #Number of master-slave partial synchronization failuresexpired_keys
: 15598177 #Number of keys that have expired since
runningevicted_keys: 0 #Number of keys that have been removed since running (after exceeding maxmemory)
keyspace_hits: 1122202228 #Number of hits
keyspace_misses: 577781396 #Number of misses
pubsub_channels: 0 #Number of channels currently in use
pubsub_patterns: 0 #Number of currently used patterns
latest_fork_usec: 15679 #Time spent in the last fork operation blocking the redis process, in microseconds
migrate_cached_sockets: 0 #

# Replication (master-slave information, information displayed on the master)
role: master #The role of the instance is master or slave
connected_slaves: 1
#Number of connected slave instances slave0: ip = 192.168.64.104, port = 9021, state = online , offset = 6713173004, lag = 0 #How many seconds does the lag slave library send the REPLCONF command to the master library
master_repl_offset: 6713173145 # Master-slave synchronization offset, if this value is the same as the offset above, the master-slave consistency is not delayed
repl_backlog_active: 1 # Whether the copy backlog buffer is turned on
repl_backlog_size: 134217728 #copy backlog buffer size
repl_backlog_first_byte_offset: 6578955418 #The size of the offset in the copy buffer
repl_backlog_histlen: 134217728 #This value is equal to master_repl_offset-repl_backlog_first_byte_offset, the value will not exceed the size of repl_backlog_size

# Replication (master-slave information, the information displayed on the slave)
role: slave
#The role of the instance is master or slave master_host: 192.168.64.102 #ip
master_port: 9021 of the master corresponding to this node #port
master_link_status of the master corresponding to this node : up #slave can check the synchronization status between it and the master. When the replication is disconnected, it means down
master_last_io_seconds_ago: 0 #How many seconds has the master library not sent data to the slave library?
master_sync_in_progress: 0 # Is the slave server synchronizing with the master server
slave_repl_offset: 6713173818 #slave replication offset
slave_priority: 100 #slave priority
slave_read_only: 1 #whether the slave library is set to read-only
connected_slaves: 0
#number of connected slave instances master_repl_offset: 0         
repl_backlog_active: 0 #replication backlog buffer is on
repl_backlog_size: 134217728 #Copy backlog buffer size
repl_backlog_first_byte_offset: 0 #Copy buffer offset size
repl_backlog_histlen: 0 #This value is equal to master_repl_offset-repl_backlog_first_byte_offset, the value will not exceed the size of repl_backlog_size

# CPU (CPU calculation statistics)
used_cpu_sys: 96894.66 #Totalize and accumulate all redis main processes in the CPU occupied by the core state
used_cpu_user: 87397.39 #Total and accumulate all redis main processes when the CPU is occupied by the user mode up
used_cpu_sys_children: 6.37 # cumulative sum up the background processes in the core state occupied by the CPU
used_cpu_user_children: 52.83 # the sums add up in a background process when the user space occupied by the CPU

# Commandstats (execution statistics of various types of commands)
cmdstat_get: calls = 1664657469, usec = 8266063320, usec_per_call = 4.97  

#call the number of times each command is executed, the total CPU time consumed by usec (in microseconds), and the average CPU time consumed each time (in microseconds)

# Cluster (Cluster related information)
cluster_enabled: 1 # Whether the instance is in cluster mode

# Keyspace (database related statistics)
db0: keys = 194690, expires = 191702, avg_ttl = 3607772262 #The number of keys of db0, and the number of keys with lifetime, average survival time

2, Redis command reference

http://doc.redisfans.com/

Guess you like

Origin www.cnblogs.com/qiantao/p/12702282.html