Benchmarking with cache-compare
Compare source-database and Readyset query latency with a temporary managed cache.
rdst query cache-compare runs a query against its source database and a
temporary local Readyset sandbox, then reports side-by-side latency statistics.
RDST prepares the sandbox, validates that both sides return equivalent results,
and removes the temporary cache when the test finishes.
Common usage
# Default: up to 100 measured executions across the selected queries
rdst query cache-compare a1b2c3d4e5f6 --target prod-orders
# Scale up the sample size
rdst query cache-compare a1b2c3d4e5f6 --target prod-orders --count 1000
# Time-bounded run
rdst query cache-compare a1b2c3d4e5f6 --target prod-orders --duration 60
# Sustained concurrent load on each side
rdst query cache-compare a1b2c3d4e5f6 --target prod-orders \
--concurrency 10 --duration 120
# Fixed start interval on each side
rdst query cache-compare a1b2c3d4e5f6 --target prod-orders \
--interval 100 --duration 60
# Share the count budget across several queries
rdst query cache-compare a1b2c3d4 f6e5d4c3 9a8b7c6d \
--target prod-orders --count 500Pass the source database target to cache-compare. RDST automatically
prepares its one local Readyset sandbox; no Readyset deployment or generated
cache target is required.
Execution modes
| Mode | Flags | Behavior |
|---|---|---|
| Fixed count | --count N | Run at most N measured executions on each side |
| Duration | --duration SECS | Stop starting work after the per-side time budget |
| Concurrency | --concurrency N | Maintain up to N concurrent executions on each side |
| Fixed interval | --interval MS | Start sequential executions at the selected interval |
--interval and --concurrency are mutually exclusive. --count remains a
hard execution cap when combined with --duration.
For multiple queries, RDST shares the requested count and duration budgets across them and tests each query sequentially. Each query gets its own temporary cache and result row. The aggregate invocation never multiplies the requested production-load budget by the number of queries.
cache-compare runs real queries against the source database. Check that the
selected count, concurrency, and duration are safe for that environment.
What RDST manages
For each query, RDST:
- Acquires the managed sandbox for the selected source target.
- Checks Readyset compatibility.
- Creates and warms an owner-scoped temporary cache.
- Validates source and Readyset results.
- Runs the bounded comparison.
- Drops the temporary cache before releasing the sandbox.
The clean sandbox may remain warm for reuse for up to 24 hours. It is not an application-facing Readyset deployment.
Flags reference
| Flag | Purpose |
|---|---|
queries | One or more registry hashes, names, or inline SQL statements |
-t, --target NAME | Source database target |
--count N | Maximum measured executions per side, shared across queries; 1-1000 |
--duration SECS | Per-side time budget, shared across queries; 1-300 |
--interval MS | Fixed start interval per side; 0-60000 |
-c, --concurrency N | Concurrent executions per side; 1-64 |
--quiet | Minimal output |
--skip-warning | Skip the source-query execution warning |
Interpreting the result
| Signal | Meaning |
|---|---|
| Readyset has lower mean and tail latency | The query benefits from Readyset under the selected workload |
| Similar latency | The source may already be fast, or the sample may be too small |
| Source is faster | Readyset does not improve this query under the selected workload |
| Results differ | RDST stops before benchmarking and reports the validation failure |
| Cleanup is partial | RDST preserves valid measurements, marks the sandbox dirty, and replaces it before reuse |
See also
rdst analyze- inspect query behavior and static Readyset compatibilityrdst query run- generate source-only query load