How to record and query the Redis slow execution log

Source: Internet
Author: User
Tags log log redis

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.