Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Redis logging system     - RHEL6.5 replace local YUM source (Linux)

- The principle Httpclient4.4 (HttpClient Interface) (Programming)

- expdp / impdp use version parameter data migration across versions (Database)

- Kubuntu 14.04 desktop to the user how to upgrade KDE 4.13.2 (Linux)

- Installing Linux and Windows 10 dual system (Linux)

- DB2 commonly used scripting sort out (Database)

- Oracle 12C RAC optimizer_adaptive_features cause of data into overtime (Database)

- Objective-C basic program structure (Programming)

- Intrusion analysis and prevention tools Knark under Linux platform (Linux)

- No password on Oracle and MySQL login (Database)

- Linux 0.12 kernel and modern kernels difference in memory management (Linux)

- RAID configuration and management under linux (Server)

- Slow update statement Performance Analysis (Database)

- Security: Unix operating system intrusion tracking Strikes Back (Linux)

- Linux_Logo - output color ANSI Linux distributions logo command-line tool (Linux)

- ARP spoofing prevent Linux environment LAN (Linux)

- Boost notes --Thread - problems encountered in the initial use on Ubuntu (Programming)

- To install Oracle Database Details and FAQ Summary under CentOS (Database)

- Ubuntu Gitolite management Git Server code base permissions (Server)

- Caffe + Ubuntu 14.04 64bit + CUDA 6.5 configuration instructions (Linux)

 
         
  Redis logging system
     
  Add Date : 2018-11-21      
         
         
         
  Today middleware interfaces response time is very long, generally after investigation, it found that access Redis is slow, and the cpu Redis has indeed risen to about 98%, and now need to locate the problem. The first open redis slowlog.

What is SLOWLOG

Slow log Redis is used to record the query execution time logging system.

Query execution time is the response does not include things like client (talking), and other IO operations to send a reply, and just execute a query time-consuming.

In addition, slow log stored in memory inside, read and write very fast, so you can safely use it, do not worry because open slow log detriment Redis speed.

Slow log behavior is specified by two configuration parameters (configuration parameter), and CONFIG commands CONFIG can modify them dynamically by overwriting files or redis.conf.

The first option is slowlog-log-slower-than, it decided to execution time is greater than the number of microseconds (microsecond, 1 second = 1,000,000 microseconds) queries recorded.

For example, execute the following command to make slow log records all queries time is greater than or equal to 100 microseconds query:

CONFIG set slowlog-log-slower-than 100

The following command logs all queries longer than 1000 microseconds query:

CONFIG set slowlog-log-slower-than 1000

Another option is slowlog-max-len, it decided to slow log can hold the maximum number of logs, slow log itself is a LIFO queue, when the queue size exceeds slowlog-max-len, one of the oldest log will be deleted, and the latest to join a log to slow log, and so on.

The following command allows slow log store up to 1000 log:

CONFIG get slowlog-max-len

Using the CONFIG command to query the current value of the two options

View slow log

To view the slow log, you can use SLOWLOG GET or SLOWLOG GET number command, the former print all slow log, the maximum length depends on the value slowlog-max-len option, and SLOWLOG number only print the specified number of logs.

The latest log will be the first to be printed

Unique id log in Redis server restart only time will reset to avoid repetitive processing of logs (for example, you might want to send e-mail notification every time you discover a new slow query).

Check the number of the current log

Using the command SLOWLOG can see the number of the current log.

Please note that the value of this distinction and slower-max-len, which is the number of a current log, a record of the number of allowed maximum log.
redis> SLOWLOG LEN
(Integer) 14

Clear log

Using the command SLOWLOG RESET can be emptied slow log.
redis> SLOWLOG LEN
(Integer) 14

redis> SLOWLOG RESET
redis> SLOWLOG LEN
(Integer) 0

By slow log can be found in the program using keys message_ * command, leading middleware long response time to modify the code troubleshooting.
     
         
         
         
  More:      
 
- CentOS7 + Redis Live Installation and Configuration (Linux)
- ImportTsv-HBase data import tool (Database)
- Vagrant build LNMP environment (Server)
- ActiveMQ5.11.1 and JDK version matching relation (Linux)
- How to use jgit to manage Git submodule (Linux)
- RHEL6.5 replace local YUM source (Linux)
- Simple Linux file system - df, du, ln (Linux)
- Start Linux ISO image directly from the hard disk (Linux)
- Installation through the network Debian 7 (Wheezy) (Linux)
- Java development specifications summary (Programming)
- Linux find and xargs (Linux)
- Redis logging system (Database)
- How to improve the performance of Ruby On Rails (Linux)
- Efficient running Linux virtual machine Six Tips (Linux)
- Those things packaged using Gradle to Android (Programming)
- To install Internet security firewall Raiders (Linux)
- Ubuntu users install the video driver Nvidia Driver 334.21 (Linux)
- System with Windows Remote Desktop to connect Ubuntu 15.04 (Linux)
- MySQL binlog automatic cleanup script (Database)
- MyEclipse configuration necessary (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.