Performance Tools
FrogDB provides several built-in tools for identifying performance bottlenecks.
Slowlog
Section titled “Slowlog”The slowlog captures commands that exceed a configurable execution time threshold.
Configuration
Section titled “Configuration”[slowlog]log-slower-than = 10000 # Threshold in microseconds (10ms). -1 = disabled, 0 = log all.max-len = 128 # Maximum number of entries retainedmax-arg-len = 128 # Maximum length of logged argument stringsCommands
Section titled “Commands”SLOWLOG GET [count] # Get recent entries (default 10, -1 = all)SLOWLOG LEN # Total entries across all shardsSLOWLOG RESET # Clear all slow query logsSLOWLOG HELP # Show help textEntry Fields
Section titled “Entry Fields”Each slowlog entry contains:
| Field | Description |
|---|---|
id | Unique entry ID |
timestamp | UNIX timestamp when the command was logged |
duration_us | Execution time in microseconds |
command | Command and arguments (truncated to max-arg-len) |
client_addr | Client IP address |
client_name | Client name (if set via CLIENT SETNAME) |
Also available as JSON via the Debug API: GET /debug/api/slowlog
Latency Bands
Section titled “Latency Bands”Latency bands provide SLO-focused tracking by counting requests that fall within configurable time buckets.
Configuration
Section titled “Configuration”[latency-bands]enabled = truebands = [1, 5, 10, 50, 100, 500] # Millisecond thresholdsWith the default bands, requests are counted in cumulative buckets: <=1ms, <=5ms, <=10ms, <=50ms, <=100ms, <=500ms.
Metric
Section titled “Metric”frogdb_latency_band_requests_total{band="<=5ms"} 123456This metric is a counter, so you can compute the rate of requests within each band using PromQL:
rate(frogdb_latency_band_requests_total[5m])Intrinsic Latency Test
Section titled “Intrinsic Latency Test”Measure the baseline latency of your system (OS scheduling, hypervisor overhead, etc.) before FrogDB starts accepting connections:
# Run a 10-second latency test and exitfrogdb-server --intrinsic-latency 10
# Run a latency check at startup (before accepting connections)frogdb-server --startup-latency-checkConfiguration:
[latency]startup-test = falsestartup-test-duration-secs = 5warning-threshold-us = 2000 # Warn if baseline latency exceeds thisHot Shard Detection
Section titled “Hot Shard Detection”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 ReferenceSee also max(frogdb_shard_keys) / avg(frogdb_shard_keys) as a Prometheus metric for alerting when the ratio exceeds 2.0.
STATUS Command
Section titled “STATUS Command”The STATUS command provides a comprehensive server health overview:
STATUS # Human-readable outputSTATUS JSON # Machine-readable JSONAlso available via HTTP: GET /status/json
Configuration for health thresholds:
[status]memory-warning-percent = 90connection-warning-percent = 90LATENCY Command
Section titled “LATENCY Command”FrogDB implements the Redis LATENCY command suite for tracking latency events:
LATENCY LATEST # Most recent latency eventsLATENCY HISTORY <event> # Historical samples for an eventLATENCY RESET [event ...] # Reset latency dataLATENCY GRAPH <event> # ASCII art graphLATENCY HISTOGRAM # Latency percentile distributionLATENCY DOCTOR # Human-readable latency analysis