Some ideas of redis monitoring

Architects who can drive 2020-11-06 21:40:24
ideas redis monitoring


Memory usage

If Redis Memory used exceeds available physical memory size , that Redis It's possible that the system will be killed . For that , You can go through info Command to used_memory and used_memory_peak monitor , Set a threshold for the amount of memory used , And set the corresponding alarm mechanism . Of course , Calling the police is just a means , It's important that you plan ahead , When memory usage is too large , What should you do , It's to clear some useless cold data , Or the Redis Move to a more powerful machine .

Persistence

If it's because of your machine or Redis Its own problems lead to Redis collapsed , So your only lifesaver might be dump Coming out rdb The file , therefore , Yes Redis dump It's also important to monitor files . It can be done by rdb_last_save_time monitor , Learn about the last time dump Time of data operation , It can also be done by rdb_changes_since_last_save Monitor to see if something goes wrong , Will lose ( That has changed ) How much data .

Keys

By acquiring Keyspace The results in the database key The number of

QPS

The number of commands executed per minute , namely :(total_commands_processed2-total_commands_processed1)/span, To get... In real time QPS, You can set the script to run in the background , Record the last few minutes of total_commands_processed. In the calculation QPS when , Use past information and current information to get QPS The estimate of .



First explain the meaning of each parameter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Server
redis_version: 2.8 . 8                      # Redis Version of
redis_git_sha 1: 00000000
redis_git_dirty: 0
redis_build_id:bf 5 d 1747 be 5380 f
redis_mode:standalone
os:Linux  2.6 . 32 -220.7 . 1 .el 6 .x 86 _ 64  x 86 _ 64
arch_bits: 64
multiplexing_api:epoll
gcc_version: 4.4 . 7                        #gcc edition
process_id: 49324                         # At present Redis Server process id
run_id:bbd 7 b 17 efcf 108 fdde 285 d 8987 e 50392 f 6 a 38 f 48
tcp_port: 6379
uptime_in_seconds: 1739082                # The elapsed time ( second )
uptime_in_days: 20                        # The elapsed time ( God )
hz: 10
lru_clock: 1734729
config_file:/home/s/apps/RedisMulti_video_so/conf/zzz.conf
 
# Clients
connected_clients: 1                      # Number of clients connected
client_longest_output_list: 0
client_biggest_input_buf: 0
blocked_clients: 0
 
# Memory
used_memory: 821848                        #Redis The total amount of memory allocated              
used_memory_human: 802.59 K
used_memory_rss: 85532672                  #Redis The total amount of memory allocated ( Including memory fragmentation )
used_memory_peak: 178987632
used_memory_peak_human: 170.70 M           #Redis Peak memory used
used_memory_lua: 33792
mem_fragmentation_ratio: 104.07            # Memory fragmentation ratio
mem_allocator:tcmalloc -2.0
 
# Persistence
loading: 0
rdb_changes_since_last_save: 0             # After the last database save , The number of times the command was executed
rdb_bgsave_in_progress: 0                  # In the background save Number of operations
rdb_last_save_time: 1410848505             # The last time successfully saved , With UNIX Time stamp format display
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec: 0
rdb_current_bgsave_time_sec: -1
aof_enabled: 0                             #redis Whether it is turned on aof
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
 
# Stats
total_connections_received: 5705           # The total number of clients connected since run
total_commands_processed: 204013           # The total number of commands executed since run
instantaneous_ops_per_sec: 0
rejected_connections: 0
sync_full: 0
sync_partial_ok: 0
sync_partial_err: 0
expired_keys: 34401                        # Expired since run key The number of
evicted_keys: 0                            # Deleted since run key The number of
keyspace_hits: 2129                        # hit key The number of times
keyspace_misses: 3148                      # Missed hit key The number of times
pubsub_channels: 0                         # Number of channels currently in use
pubsub_patterns: 0                         # The number of patterns currently in use
latest_fork_usec: 4391
 
# Replication
role:master                              # The role of the current instance master still slave
connected_slaves: 0
master_repl_offset: 0
repl_backlog_active: 0
repl_backlog_size: 1048576
repl_backlog_first_byte_offset: 0
repl_backlog_histlen: 0
 
# CPU
used_cpu_sys: 1551.61
used_cpu_user: 1083.37
used_cpu_sys_children: 2.52
used_cpu_user_children: 16.79
 
# Keyspace
db 0: keys= 3 ,expires= 0 ,avg_ttl= 0              # Of each database key The number of , And with a lifetime key The number of

版权声明
本文为[Architects who can drive]所创,转载请带上原文链接,感谢

  1. redis 监控的一些构思
  2. Spring中获取request的几种方法,及其线程安全性分析
  3. Several methods of getting request in spring and its thread security analysis
  4. 20分钟带你掌握JavaScript Promise和 Async/Await
  5. 20 minutes with async and async
  6. Mybatis - introduction, simple entry program
  7. Java Concurrent Programming: concurrent HashMap
  8. Mybatis: one to one association query
  9. Java IO
  10. Deep understanding of Java generics
  11. Object oriented [day07]: review of knowledge points (11)
  12. Chapter 2 spring
  13. Process of building minicube in local k8s environment
  14. Interpretation of jQuery source code
  15. Making web full screen effect with jquery
  16. Java 7 exception handling new features - address suppressed () method
  17. Spring 4 uses websocket
  18. Using openldap to answer questions and using java to complete LDAP authentication
  19. Implementation of MySQL high availability cluster with corosync + pacemaker and DRBD
  20. Java production of a simple tank war
  21. Design pattern day02
  22. Hadoop pseudo Distributed installation and running test example
  23. Java Concurrent Programming: callable, future and futuretask
  24. Understanding the three characteristics of Java encapsulation
  25. Understanding closure of JavaScript
  26. Java set excel worksheet to read only
  27. Distributed Java service platform baratine
  28. Java barcode generation technology barcode4j
  29. Use springboot + MySQL + JPA to add, delete, change, query and page the database
  30. Distributed services framework Dubbo / dubbox getting started example
  31. Zookeeper notes (1) installation, deployment and hello world
  32. Oracle database trigger Usage Summary
  33. MySQL master replication with slave server