OPS needs to record the "slow action" commands in the master Redis and then find the relevant business party, otherwise, block
It's not funny anymore. The relevant commands are then found directly in the Redis Handbook.
SLOWLOG subcommand [argument] What is Slowlogslow log is the journaling system used by Redis to record query execution times. Query execution time refers to not including IO operations such as client response (talking), sending replies, and simply the time spent executing a query command. In addition, the slow log is stored in memory and reads and writes very quickly, so you can use it with confidence, without worrying about the speed of Redis due to opening slow log. The behavior of setting Slowlogslow log is specified by two configuration parameters (config parameter), which can be dynamically modified by overwriting redis.conf files or by using the config GET and config SET commands. The first option is Slowlog-log-slower-than, which determines how many microseconds (microsecond,1 seconds = 1,000,000 microseconds) of execution time are logged. For example, executing the following command will let slow log log all queries that have a query time greater than or equal to 100 microseconds: Config set Slowlog-log-slower-than 100 and the following command logs all queries with a query time greater than 1000 microseconds: Config set slo Wlog-log-slower-than 1000 Another option is Slowlog-max-len, which determines how many logs slow log can hold, slow log itself is a FIFO queue when the queue size exceeds Slowlog-max-len , the oldest log is deleted, and the latest log is added to slow log, and so on. The following command allows slow log to save up to 1000 logs: CONFIG SET Slowlog-max-len 1000
From the above paragraph, probably see the two properties: Slowlog-log-slower-than and Slowlog-max-len, for testing convenience, I do not config set, directly to get rid of
redis.conf files can ...
# The following time is expressed in microseconds and so 1000000 are 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 0# There is the no limit to this length. Just be aware that it'll consume memory.# you can reclaim memory used by the slow log with Slowlog Reset.slowlog-max-len 10
Then I simply test that all the command will be recorded in the Slowlog inside, the red box is the comand execution time.
With this, can I now find out which slow command commands are on all the lines??? So that everyone will not be passing the buck ...
Redis Slow Query log