NOTE
3.3 Redis Slow Queries
Redis requests pass through sending, queuing, execution, and response stages. These notes distinguish their costs and the execution time tracked by slow queries.
This is a historical learning note and may contain outdated or incomplete understanding.
1. Redis Command Execution Flow
- The client sends a command to the server.
- The server queues the command.
- The server executes the command.
- Slow-query statistics measure this time.
- The server returns the result.
2. Usage
2.1. Record Slow Queries
# Slow queries are recorded in an in-memory queue. Generally set to 1000
slowlog-max-len=1000
# Threshold, in microseconds. Generally set to 1 ms
slow-log-slower-than=10000
2.2. Slow-Query Commands
slowlog get [n]
slowlog len
slowlog reset
2.3. Analyze the Cause of Slow Queries
3. Implementation
A first-in-first-out queue stored in memory.
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub