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.

ParameterPhaseDefaultEnv OverrideEffect
nlistBuild2048—IVF Voronoi centroids
subdimBuild8L2_SUBDIMDimensions per PQ8 subquantizer
spillBuild1L2_SPILLMulti-assignment factor (spill=2 boosts recall)
opqBuildauto—OPQ rotation before residual PQ8 encoding
rerank_precisionBuildAutoL2_RESIDUALU8 (1B/d), F16 (2B/d), or P4K–P10K Lloyd codebooks
balanced_nprobeSearch144L2_BALANCED_NPROBECoarse IVF lists scanned per query
balanced_rerankSearch1200L2_BALANCED_RERANKTop 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.

Dataset1 Worker QPS (p99)8 Workers QPS (p99)16 Workers QPS (p99)
SIFT-1M1,591.9 QPS (1.43 ms)7,648.9 QPS (1.73 ms)6,466.9 QPS (6.24 ms)
Deep-1M1,724.2 QPS (1.23 ms)10,516.8 QPS (1.27 ms)10,211.9 QPS (5.33 ms)