• notice
  • Congratulations on the launch of the Sought Tech site

About redis slow log slowlog

Today, because of a problem with redis, I used the slow log to troubleshoot the problem and take a note.The slow log is not only available on mysql , Redis also exists, which is easy to understand.They are all databases.Their role is to provide business calls.Of course, time-consuming statistics of business calls are required.The following configuration recommendations are available in redis.conf:

slowlog about redis slowlog

the slowlog above -log-slower-than is the threshold setting of the slow log, that is, the slow log will be recorded when the query time reaches or exceeds this value.The setting value below means that a maximum of 128 slow log records are recorded, because the slow log and other redis data The same, it will be recorded in the memory.Therefore, in order to reduce the memory footprint of the slow log, a small value can be set in this place.

Used in php: Redis->slowlog('GET',100); extract slow log, 100 refers to the number of extracted, the data structure of slow log is also very simple:

< p style="text-align:center;"> slowlog about redis slowlog

The first value in the array is the auto-increment ID, which can be ignored.The second value is the time when this slow log occurred, and the third value is the time record of this operation (unit: microseconds) ).The fourth value is the command and parameter of this operation.Today, I printed out a total of 15 slow logs, LRANGE occupies 7 of them, save occupies 3, and one flushall.The other keys, * and del operations are executed under the command line.It seems that you cannot rely on lrange too much.Ah, as shown below:

slowlog about redis slowlog

Tags

Technical otaku

Sought technology together

Related Topic

1 Comments

author

lipitor canada & lt;a href="https://lipiws.top/"& gt;lipitor 40mg ca& lt;/a& gt; purchase lipitor

Oaooqf

2024-03-08

Leave a Reply

+