Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the slow query in Redis

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "what is the slow query in Redis". In the daily operation, I believe that many people have doubts about what the slow query in Redis is. The editor consulted all kinds of materials and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubt of "what is the slow query in Redis?" Next, please follow the editor to study!

It has been described in other Redis articles that a Redis command is executed in four steps:

Send a command

Command queue

Command execution

Return the result

This is shown in the following figure:

Note: the slow query described above refers to the time in step 3, that is, the execution time of the Redis command, so the slow query time in Redis is not the same as the client timeout.

Configuration parameters of slow query

To use the slow query feature in Redis, we need to understand two things:

How to set timeout parameters

Log directory recorded

In Redis we can use the

Showlog-log-slower-than

Parameter to set the timeout of the command, and the unit of the timeout is subtle (1 second = 1000 milliseconds = 1000000 subtle)

Showlog-log-slower-than

The parameter has its own default value, which defaults to 10000. That is, if we do not modify any parameters in Redis, when the execution time of a command in Redis exceeds 10000 subtleties, Redis will log the information about the command.

Note: if the parameter showlog-log-slower-than=0, Redis will record all executed commands, if when showlog-log-slower-than

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report