Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Redis logging system     - Install snort intrusion detection system on Debian (Linux)

- 20 Top Linux commands (Linux)

- PXE installation of Linux servers (Server)

- Java inheritance initialization problem (Programming)

- Linux Firewall Basics (Linux)

- Mind mapping software installed in CentOS 7 in XMind (Linux)

- Linux Command Tutorial: cat command to view the contents of the file (Linux)

- Linux SSH login without a password (Linux)

- Availability Hadoop platform - Oozie Workflow (Server)

- sudo command scenario analysis (Linux)

- grep command Detailed and relevant examples (Linux)

- VNC configuration detailed analysis under Linux (Linux)

- C ++ runtime environment built on CentOS 6.6 and Oracle database connection (Database)

- How to install and configure a VNC server on CentOS 7.0 (Server)

- Linux NFS service fixed ports and firewall configuration (Linux)

- How to implement Linux host Telnet SSH password Free (Server)

- Linux remote connectivity tools -OpenSSH (Linux)

- Using IPFilter bridge filter in the FreeBSD system (Linux)

- Mac OS X command line to submit the local project to Git (Server)

- Install FFmpeg compiling from source in Mac OS X environment (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:      
 
- Let CentOS perform PPPoE dial-up, ADSL can be used in a network environment! (Linux)
- Attic-- delete duplicate data backup program (Linux)
- Use Pylint regulate your Python code (Programming)
- Talk about Java in the collection (Programming)
- Linux system font color change (Linux)
- Teamviewer not start in Linux (Linux)
- Disable unnecessary services under Linux (Linux)
- Oracle Execute to Parse perform analytical Ratio Analysis (Database)
- MySQL uses Federate engine mapping table to achieve operation of the local remote operation table (Database)
- Automatic batch resolve dependencies problem locally installed rpm package (Linux)
- Java Graphics2D Paint (Programming)
- C # DateTime structure common method (Programming)
- Linux gprof oprofiling and performance testing tools (Linux)
- CentOS 6.5 system installation Oracle11.2.0.4 basic steps (Database)
- Linux System Getting Started Learning: Repair fatal error openssl aes h no such file or directory (Linux)
- Ubuntu users to install Gnome-Pie 0.6.5 (Linux)
- MogileFS system installation configuration example (Server)
- The most concise explanation of JavaScript closures (Programming)
- Hadoop namenode do NFS disaster recovery (Server)
- C language macro definition #define Usage (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.