Redis学习之查看服务器运行状态(第三十五天)

管理 redis 服务

127.0.0.1:6379> INFO 
# Server
redis_version:5.0.8
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:fb7771d11d193afb
redis_mode:standalone
os:Linux 3.10.0-327.el7.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:4.8.5
process_id:3072
run_id:5b122c5837fd01680bd96f4d7c8be6f3115e72ca
tcp_port:6379
uptime_in_seconds:106305
uptime_in_days:1
hz:10
configured_hz:10
lru_clock:10053625
executable:/home/liusenlin/redis-5.0.8/src/./redis-server
config_file:/home/liusenlin/redis-5.0.8/redis.conf

# Clients
connected_clients:2
client_recent_max_input_buffer:2
client_recent_max_output_buffer:0
blocked_clients:0

# Memory
used_memory:879008
used_memory_human:858.41K
used_memory_rss:2592768
used_memory_rss_human:2.47M
used_memory_peak:879008
used_memory_peak_human:858.41K
used_memory_peak_perc:100.15%
used_memory_overhead:860064
used_memory_startup:792496
used_memory_dataset:18944
used_memory_dataset_perc:21.90%
allocator_allocated:914536
allocator_active:1208320
allocator_resident:4292608
total_system_memory:3880488960
total_system_memory_human:3.61G
used_memory_lua:39936
used_memory_lua_human:39.00K
used_memory_scripts:152
used_memory_scripts_human:152B
number_of_cached_scripts:1
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
allocator_frag_ratio:1.32
allocator_frag_bytes:293784
allocator_rss_ratio:3.55
allocator_rss_bytes:3084288
rss_overhead_ratio:0.60
rss_overhead_bytes:-1699840
mem_fragmentation_ratio:3.10
mem_fragmentation_bytes:1756008
mem_not_counted_for_evict:0
mem_replication_backlog:0
mem_clients_slaves:0
mem_clients_normal:66616
mem_aof_buffer:0
mem_allocator:jemalloc-5.1.0
active_defrag_running:0
lazyfree_pending_objects:0

# Persistence
loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1587099216
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:0
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:380928
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
aof_last_cow_size:0

# Stats
total_connections_received:103
total_commands_processed:209
instantaneous_ops_per_sec:0
total_net_input_bytes:15430
total_net_output_bytes:175894
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0
expired_stale_perc:0.00
expired_time_cap_reached_count:0
evicted_keys:0
keyspace_hits:16
keyspace_misses:2
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:411
migrate_cached_sockets:0
slave_expires_tracked_keys:0
active_defrag_hits:0
active_defrag_misses:0
active_defrag_key_hits:0
active_defrag_key_misses:0

# Replication
role:master
connected_slaves:0
master_replid:1ba1542b6c07b45306f23e168d8156243c5bd267
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:0
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:70.426299
used_cpu_user:95.901434
used_cpu_sys_children:0.032598
used_cpu_user_children:0.002445

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=16,expires=0,avg_ttl=0
127.0.0.1:6379> 

服务器侧检测命令,调试使用:

db0:keys=16,expires=0,avg_ttl=0
127.0.0.1:6379> MONITOR
OK
1587112048.643018 [0 127.0.0.1:36014] "auth" "123456"

[liusenlin@localhost src]$ ./redis-cli 
127.0.0.1:6379> BGSAVE
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 123456
OK
127.0.0.1:6379> BGSAVE
Background saving started
127.0.0.1:6379> CLIENT GETNAME
(nil)
127.0.0.1:6379> CLIENT SETNAME lsl
OK
127.0.0.1:6379> CLIENT GETNAME
"lsl"
127.0.0.1:6379> CLUSTER COUNTKEYSINSLOT
(error) ERR This instance has cluster support disabled
127.0.0.1:6379> CLUSTER SAVECONFIG
(error) ERR This instance has cluster support disabled
127.0.0.1:6379> CLUSTER SLAVES
(error) ERR This instance has cluster support disabled
127.0.0.1:6379> TIME
1) "1587112253"
2) "507347"
127.0.0.1:6379> COMMAND INFO list
1) (nil)
127.0.0.1:6379> COMMAND INFO  client
1) 1) "client"
   2) (integer) -2
   3) 1) admin
      2) noscript
   4) (integer) 0
   5) (integer) 0
   6) (integer) 0
127.0.0.1:6379> DBSIZE
(integer) 16
127.0.0.1:6379> DEBUG OBJECT book
(error) ERR no such key
127.0.0.1:6379> DEBUG OBJECT lsl
(error) ERR no such key
127.0.0.1:6379> DEBUG OBJECT myhash
Value at:0x7fac312b96a0 refcount:1 encoding:ziplist serializedlength:52 lru:9971166 lru_seconds_idle:82880
127.0.0.1:6379> 
发布了205 篇原创文章 · 获赞 47 · 访问量 26万+

猜你喜欢

转载自blog.csdn.net/qq_32744005/article/details/105577094
今日推荐