Tuning & Calibration
Tuning Guide
Balance QPS, p99 tail latency, Recall@10/100, and RSS memory using nlist, subdim, spill, OPQ, RerankPrecision, and adaptive rerank.
Build-Time & Search-Time Knobs
nprobe controls candidate coverage (Recall@100): scan work scales linearly as nprobe * (N / nlist). rerank controls top-k ranking accuracy (Recall@1 / Recall@10): exact RerankStore scoring eliminates PQ8 ordering errors.
| Parameter | Phase | Default | Env Override | Effect |
|---|---|---|---|---|
| nlist | Build | 2048 | — | IVF Voronoi centroids |
| subdim | Build | 8 | L2_SUBDIM | Dimensions per PQ8 subquantizer |
| spill | Build | 1 | L2_SPILL | Multi-assignment factor (spill=2 boosts recall) |
| opq | Build | auto | — | OPQ rotation before residual PQ8 encoding |
| rerank_precision | Build | Auto | L2_RESIDUAL | U8 (1B/d), F16 (2B/d), or P4K–P10K Lloyd codebooks |
| balanced_nprobe | Search | 144 | L2_BALANCED_NPROBE | Coarse IVF lists scanned per query |
| balanced_rerank | Search | 1200 | L2_BALANCED_RERANK | Top PQ8 candidates passed to exact RerankStore |
Worker Thread Scaling
For latency-sensitive workloads, pin workers to physical performance cores (e.g. 8 on a 16-logical-core hybrid CPU) to keep p99 under 2 ms. For maximum throughput, scale to logical core count.
| Dataset | 1 Worker QPS (p99) | 8 Workers QPS (p99) | 16 Workers QPS (p99) |
|---|---|---|---|
| SIFT-1M | 1,591.9 QPS (1.43 ms) | 7,648.9 QPS (1.73 ms) | 6,466.9 QPS (6.24 ms) |
| Deep-1M | 1,724.2 QPS (1.23 ms) | 10,516.8 QPS (1.27 ms) | 10,211.9 QPS (5.33 ms) |