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
|