Redis5.0.3配置文件详解(易读白话翻译)慢日志与延迟监控

编程

########################## CLUSTER DOCKER/NAT support  ########################

# In certain deployments, Redis Cluster nodes address discovery fails, because

# addresses are NAT-ted or because ports are forwarded (the typical case is

# Docker and other containers).

#

# In order to make Redis Cluster working in such environments, a static

# configuration where each node knows its public address is needed. The

# following two options are used for this scope, and are:

#

# * cluster-announce-ip

# * cluster-announce-port

# * cluster-announce-bus-port

#

# Each instruct the node about its address, client port, and cluster message

# bus port. The information is then published in the header of the bus packets

# so that other nodes will be able to correctly map the address of the node

# publishing the information.

#

# If the above options are not used, the normal Redis Cluster auto-detection

# will be used instead.

#

# Note that when remapped, the bus port may not be at the fixed offset of

# clients port + 10000, so you can specify any port and bus-port depending

# on how they get remapped. If the bus-port is not set, a fixed offset of

# 10000 will be used as usually.

#

# Example:

#

# cluster-announce-ip 10.1.1.5

# cluster-announce-port 6379

# cluster-announce-bus-port 6380

################################## SLOW LOG 慢日志 ###################################

# The Redis Slow Log is a system to log queries that exceeded a specified

# execution time. The execution time does not include the I/O operations

# like talking with the client, sending the reply and so forth,

# but just the time needed to actually execute the command (this is the only

# stage of command execution where the thread is blocked and can not serve

# other requests in the meantime).

# 记录Redis执行耗时超过指定值的"查询命令",整个"耗时"仅仅是执行命令的耗时(在这段时间内,因为线程被阻塞,其他命令会被阻塞),不包括与客户端网络IO所耗时间或者发数据给客户端的耗时

#

# You can configure the slow log with two parameters: one tells Redis

# what is the execution time, in microseconds, to exceed in order for the

# command to get logged, and the other parameter is the length of the

# slow log. When a new command is logged the oldest one is removed from the

# queue of logged commands.

# 可以使用"slowlog-log-slower-than"指定耗时的阈值(单位是微妙),一旦执行超过这个时间就会记录日志到缓冲区

# 可以使用"slowlog-max-len 128"指定队列长度,如果超过队列,最老的元素会被覆盖

#

# The following time is expressed in microseconds, so 1000000 is equivalent

# to one second. Note that a negative number disables the slow log, while

# a value of zero forces the logging of every command.

# 单位是微妙,不能设置为负值,如果设置为0,那么所有的查询命令都会记录到队列中

#

slowlog-log-slower-than 10000

# There is no limit to this length. Just be aware that it will consume memory.

# 最大值没有限制,我们只需要考虑内存是否足够大

# You can reclaim memory used by the slow log with SLOWLOG RESET.

# 可以使用slowlog reset回收已使用的内存

slowlog-max-len 128

################################ LATENCY MONITOR ##############################

# The Redis latency monitoring subsystem samples different operations

# at runtime in order to collect data related to possible sources of

# latency of a Redis instance.

# 延迟监控子系统通过采集运行时的不同操作去收集造成Redis实例延迟的相关可能来源

#

#

# Via the LATENCY command this information is available to the user that can

# print graphs and obtain reports.

# 可以通过latency命令获得可用信息的图表,比如latency docter xxx/latency graph等

#

# The system only logs operations that were performed in a time equal or

# greater than the amount of milliseconds specified via the

# latency-monitor-threshold configuration directive. When its value is set

# to zero, the latency monitor is turned off.

# 该监控子系统只会记录那些耗时>="latency-monitor-threshold"指定的值对应的操作,如果设置为0,表示关闭延时监控

#

# By default latency monitoring is disabled since it is mostly not needed

# if you don"t have latency issues, and collecting data has a performance

# impact, that while very small, can be measured under big load. Latency

# monitoring can easily be enabled at runtime using the command

# "CONFIG SET latency-monitor-threshold <milliseconds>" if needed.

# Redis默认是关闭了延迟监控的,因为绝大多数时间是用不着的,因为开启它有一定的性能损失,除非你的服务发生了延时而开启监控

# 当Redis是运行着的时候,可以通过config set latency-monitor-threshold xxx轻松开启监控

latency-monitor-threshold 0

 

以上是 Redis5.0.3配置文件详解(易读白话翻译)慢日志与延迟监控 的全部内容, 来源链接: utcz.com/z/513252.html

回到顶部