kv_bench/README.md

75 lines
1.9 KiB
Markdown

# kv_bench (Mace vs RocksDB)
Quick start for reproducible comparison. Full guide: [docs/repro.md](./docs/repro.md).
## 5-Minute Quickstart
1. Set your storage root (any mount path, not hardcoded to `/nvme`):
```bash
export KV_BENCH_STORAGE_ROOT=/path/to/your/storage/kvbench
mkdir -p "${KV_BENCH_STORAGE_ROOT}"
```
2. Initialize Python env once:
```bash
cd /home/abby/kv_bench/scripts
./init.sh
source ./bin/activate
cd /home/abby/kv_bench
```
3. Run baseline comparison (both engines write to the same CSV):
```bash
rm -rf "${KV_BENCH_STORAGE_ROOT}/basic_mace" "${KV_BENCH_STORAGE_ROOT}/basic_rocks"
mkdir -p "${KV_BENCH_STORAGE_ROOT}/basic_mace" "${KV_BENCH_STORAGE_ROOT}/basic_rocks"
./scripts/mace.sh "${KV_BENCH_STORAGE_ROOT}/basic_mace" ./scripts/benchmark_results.csv
./scripts/rocksdb.sh "${KV_BENCH_STORAGE_ROOT}/basic_rocks" ./scripts/benchmark_results.csv
```
4. View and plot results:
```bash
./scripts/bin/python ./scripts/plot.py ./scripts/benchmark_results.csv ./scripts
```
## Fast Result Reading
- Raw input CSV: `./scripts/benchmark_results.csv`
- Key columns:
- `engine` (`mace` / `rocksdb`)
- `workload_id` (`W1..W6`)
- `ops_per_sec` (higher is better)
- `p99_us` (lower is better)
- `error_ops` (must be 0 before drawing conclusions)
## Phase Reports
- Phase 1 (stability CV):
```bash
./scripts/bin/python ./scripts/phase1_eval.py ./scripts/phase1_results.csv
```
- Phase 2 (core median + slow scenarios):
```bash
./scripts/bin/python ./scripts/phase2_report.py ./scripts/phase2_results.csv
```
- Phase 3 (durability cost):
```bash
./scripts/bin/python ./scripts/phase3_report.py ./scripts/phase3_results.csv
```
- Phase 4 (restart/recovery):
```bash
./scripts/bin/python ./scripts/phase4_report.py ./scripts/phase4_restart_mace.csv
./scripts/bin/python ./scripts/phase4_report.py ./scripts/phase4_restart_rocks.csv
```
## Full Reproduction
For phase-by-phase commands, knobs, and interpretation rules, use [docs/repro.md](./docs/repro.md).