Skip to content

Performance Tools

FrogDB provides several built-in tools for identifying performance bottlenecks.

The slowlog captures commands that exceed a configurable execution time threshold.

[slowlog]
log-slower-than = 10000 # Threshold in microseconds (10ms). -1 = disabled, 0 = log all.
max-len = 128 # Maximum number of entries retained
max-arg-len = 128 # Maximum length of logged argument strings
SLOWLOG GET [count] # Get recent entries (default 10, -1 = all)
SLOWLOG LEN # Total entries across all shards
SLOWLOG RESET # Clear all slow query logs
SLOWLOG HELP # Show help text

Each slowlog entry contains:

FieldDescription
idUnique entry ID
timestampUNIX timestamp when the command was logged
duration_usExecution time in microseconds
commandCommand and arguments (truncated to max-arg-len)
client_addrClient IP address
client_nameClient name (if set via CLIENT SETNAME)

Also available as JSON via the Debug API: GET /debug/api/slowlog

Latency bands provide SLO-focused tracking by counting requests that fall within configurable time buckets.

[latency-bands]
enabled = true
bands = [1, 5, 10, 50, 100, 500] # Millisecond thresholds

With the default bands, requests are counted in cumulative buckets: <=1ms, <=5ms, <=10ms, <=50ms, <=100ms, <=500ms.

frogdb_latency_band_requests_total{band="<=5ms"} 123456

This metric is a counter, so you can compute the rate of requests within each band using PromQL:

rate(frogdb_latency_band_requests_total[5m])

Measure the baseline latency of your system (OS scheduling, hypervisor overhead, etc.) before FrogDB starts accepting connections:

Terminal window
# Run a 10-second latency test and exit
frogdb-server --intrinsic-latency 10
# Run a latency check at startup (before accepting connections)
frogdb-server --startup-latency-check

Configuration:

[latency]
startup-test = false
startup-test-duration-secs = 5
warning-threshold-us = 2000 # Warn if baseline latency exceeds this

Identify imbalanced key distribution across shards:

DEBUG HOTSHARDS [PERIOD <seconds>]

This shows per-shard traffic analysis including key count, memory usage, and queue depth. Configure detection thresholds:

[hotshards]
# Thresholds are documented in the Configuration Reference

See also max(frogdb_shard_keys) / avg(frogdb_shard_keys) as a Prometheus metric for alerting when the ratio exceeds 2.0.

The STATUS command provides a comprehensive server health overview:

STATUS # Human-readable output
STATUS JSON # Machine-readable JSON

Also available via HTTP: GET /status/json

Configuration for health thresholds:

[status]
memory-warning-percent = 90
connection-warning-percent = 90

FrogDB implements the Redis LATENCY command suite for tracking latency events:

LATENCY LATEST # Most recent latency events
LATENCY HISTORY <event> # Historical samples for an event
LATENCY RESET [event ...] # Reset latency data
LATENCY GRAPH <event> # ASCII art graph
LATENCY HISTOGRAM # Latency percentile distribution
LATENCY DOCTOR # Human-readable latency analysis