SLOW LOG部分:
1.慢日志设置:
# 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).
#
# 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.
# 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.
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-max-len 128
Redis Slow Log是一个系统到日志的查询,它超过了指定的执行时间。执行时间不包括与客户机交谈、发送应答等I/O操作,而只是实际执行命令所需的时间(这是命令执行的唯一阶段,线程被阻塞,不能同时服务于其他请求),您可以使用两个参数配置慢日志:一个参数告诉Redis要超过多少执行时间(微秒),以便记录命令;另一个参数是慢日志的长度。记录新命令时,最旧的命令将从记录的命令队列中删除。以下时间以微秒表示,因此1000000等于1秒。请注意,负数将禁用慢日志,而值为零将强制记录每个命令。这个长度没有限制。只是要知道它会消耗内存。你可以通过slow log重置回收慢日志使用的内存。
网友评论