HNSW & Token Tuning
Configuring Qdrant memmap_threshold_kb for NVMe Scaling
Offload cold tenant segments onto NVMe via OS mmap while keeping hot HNSW graphs pinned in RAM for multi-million-vector memory clusters.
memmap_threshold_kb: 20000 · 75% Lower RSS · NVMe Required
Why mmap Requires High-Frequency Local NVMe
Memory-mapped vector segments rely on Linux virtual memory page faults whenever a cold tenant wakes up. On slow network-attached HDD/block storage, page faults spike p99 search to 400ms+; on local NVMe (Vultr High Frequency), cold reads settle around 15-28ms.
Pairing mmap With Always-RAM HNSW Upper Layers
Even when raw vectors live on disk, keeping quantized int8 vectors or upper HNSW navigation layers in RAM avoids random 4KB disk seeks during graph entry.
Measured Thresholds & Vector Stack Parameters
| Collection Scale | Recommended memmap_threshold_kb | Expected RAM Behavior |
|---|---|---|
| < 500k vectors | 200000 (keep in RAM) | Zero disk paging; sub-10 ms p99 search |
| 1M - 5M vectors | 50000 + int8 always_ram: true | HNSW int8 stays in RAM; payloads & fp32 on NVMe |
| 5M - 25M vectors | 20000 + on_disk: true | OS page cache dynamically holds active working set |