Redis is a single-threaded operation, and a slow execution, which allows for a large number of subsequent execution delays, greatly reduces throughput. Recording, querying, and monitoring redis slow execution is significant. Redis's slowlog are only recorded in memory and are highly efficient without worrying too much about performance. Off-topic, Redis is really a complete tool, not simply a memory database. Configure Slowlog
' Config get slowlog-log-slower-than '
query log's time threshold (microseconds, one millisecond equals 1000 microseconds), and statements larger than that number will be logged. Negative numbers mean no records, 0 records all.
' config set Slowlog-log-slower-than 30000 '
sets the log's time threshold to 30 milliseconds
' config get slowlog-max-len '
query log for the maximum number of bars. Larger than this number, the old will be discarded.
' config set Slowlog-max-len '
sets the maximum number of bars for log to 300.
Query log
' Slowlog Len '
How many logs are there?
' Slowlog get '
Show All Log
' Slowlog get 10 '
Shows the format description of the most recent 10 log log
10.19.10.44:7395> Slowlog Get 1
1) 1) (integer) 55265//log ID
2) (integer) 1506669325//Unix timestamp
3) (integer) 19283//execution time, microseconds
4) 1) "Smembers"//redis command and Parameters
2) "ip_set_b7c6e785bb264a9d87548dfe40e5de5f_2017-09-29" reference link Redis slowlog