Skip to main content
The Redis Slow Log captures commands that exceed a configured execution time threshold. Use it to identify performance bottlenecks, optimize queries, and monitor command patterns that impact your application.

Key Concepts

Slow Log

An in-memory log of commands that exceeded the configured duration threshold.

Threshold

Commands slower than slowlog-log-slower-than microseconds are logged.

Execution Time

Time spent executing the command, not including network latency or queue time.

Log Size

Maximum entries stored is controlled by slowlog-max-len configuration.

Required Permissions

ActionPermission
View slow logiam:project:infrastructure:redis:read

Duration Severity Levels

LevelDurationMeaning
Normal< 10msTypical command execution
Warning10ms - 99msPotentially slow, worth investigating
Critical>= 100msVery slow, likely impacting performance

How to View Slow Log

1

Select Connection

Choose a Redis connection from the dropdown.
2

Browse Entries

Slow log entries are displayed with ID, timestamp, command, client, and duration.
3

Filter Results

Use search, client filter, or duration filter to find specific entries.

How to Search Commands

1

Enter Search Term

Type a command or keyword in the search box.
2

View Matches

Results filter to show only entries containing the search term.
Search for specific commands like KEYS, SCAN, or SORT to find common performance issues.

How to Filter by Client

1

Enter Client Address

Type an IP address or client name in the client filter.
2

View Client Commands

Results show only slow commands from matching clients.

How to Filter by Duration

1

Select Duration Threshold

Choose from preset duration filters:
  • All: Show all slow log entries
  • > 1ms: Commands slower than 1 millisecond
  • > 5ms: Commands slower than 5 milliseconds
  • > 10ms: Commands slower than 10 milliseconds
  • > 50ms: Commands slower than 50 milliseconds
  • > 100ms: Commands slower than 100 milliseconds
2

Review Filtered Results

Only entries exceeding the selected duration are displayed.

Understanding Slow Log Entries

Each entry contains:
FieldDescription
IDSequential entry number (decrements for older entries)
TimestampWhen the command was executed
CommandThe full command with arguments
ClientIP address and port of the client
Client NameOptional name set by CLIENT SETNAME
DurationExecution time in microseconds/milliseconds

Common Slow Commands

CommandWhy It’s SlowAlternative
KEYS *Scans entire keyspaceUse SCAN with patterns
SMEMBERS (large set)Returns all membersUse SSCAN for pagination
HGETALL (large hash)Returns all fieldsUse HSCAN or specific HGET
SORTCPU-intensive operationPre-sort data or use sorted sets
LRANGE 0 -1Returns entire listPaginate with offset/count
DEBUG SLEEPIntentional delayRemove from production

How to Configure Slow Log

The slow log is configured through Redis configuration parameters.

Threshold Setting

slowlog-log-slower-than <microseconds>
ValueMeaning
10000Log commands slower than 10ms (default)
1000Log commands slower than 1ms
0Log all commands (debugging only)
-1Disable slow log

Maximum Entries

slowlog-max-len <count>
ValueMeaning
128Keep last 128 entries (default)
1000Keep more history for analysis
0Unlimited (uses memory)
Configure these settings in the Redis Configuration page. Changes take effect immediately.

How to Clear Slow Log

The slow log can be cleared using Redis CLI:
SLOWLOG RESET
Clearing the slow log removes all entries permanently. Export or document important findings before clearing.

Troubleshooting

  • The threshold may be set too high (lower slowlog-log-slower-than)
  • Slow log may have been recently reset
  • Commands may genuinely be fast
  • Check if slow log is disabled (slowlog-log-slower-than -1)
  • Increase threshold to capture only slower commands
  • Use duration filter to focus on critical entries
  • Check for problematic command patterns
  • Consider application optimization
  • Identify the calling application
  • Check for inefficient loops or queries
  • Consider caching results
  • Optimize the command or data structure
  • Replace with SCAN command
  • KEYS blocks the server during execution
  • Never use KEYS in production code
  • Consider using key naming conventions for SCAN patterns
  • Use SCAN variants (SSCAN, HSCAN, ZSCAN)
  • Paginate with LIMIT when possible
  • Consider breaking large collections into smaller ones
  • Check if all data is actually needed
  • Check persistence settings (AOF fsync)
  • Monitor disk I/O
  • Large values take longer to write
  • Check replication lag if using replicas

FAQ

Execution time measures only the time Redis spends processing the command. It does not include network latency, client queue time, or time waiting for slow log recording.
Minimal impact. The slow log is stored in memory with a fixed size limit. Recording entries is fast. Very high-traffic systems with slowlog-log-slower-than 0 may see slight overhead.
Entries are kept until the log reaches slowlog-max-len entries. Oldest entries are removed when new ones are added. The log is also cleared on server restart.
The default threshold is 10ms. Commands just over this appear in the log. During high load, normally fast commands may slow down due to queueing or CPU contention.
Use SLOWLOG GET <count> in Redis CLI to retrieve entries. The UI displays entries for analysis; use CLI for programmatic export.
Start with the default 10ms. Adjust based on your latency requirements. For real-time applications, consider 1-5ms. For batch processing, 50-100ms may be acceptable.
SCAN is non-blocking and cursor-based, so it doesn’t freeze Redis. However, scanning millions of keys still takes time. Use specific patterns and limit result sets.
Use CLIENT SETNAME in your applications to set descriptive client names. The slow log will show these names, making it easy to trace commands to specific services.

Best Practices

Monitoring

  • Review slow log regularly, not just during incidents
  • Set up alerts for unusual slow log growth
  • Track common slow commands over time
  • Compare slow log patterns after deployments

Threshold Tuning

  • Start with defaults, adjust based on requirements
  • Lower threshold during optimization efforts
  • Raise threshold if log fills too quickly
  • Consider different thresholds for different environments

Command Optimization

  • Replace KEYS with SCAN patterns
  • Use pipeline for multiple commands
  • Paginate large collection reads
  • Consider data structure changes for frequent slow operations

Application Design

  • Set CLIENT SETNAME for each service
  • Cache frequently accessed data
  • Batch operations when possible
  • Monitor client-side latency alongside slow log