Skip to content
/
Suscribirse Subscribe

Detrás del telón hay sistemas, no magia. Arquitectura de software, IA y computación de bajo nivel para las trincheras de producción.

Behind the curtain there are systems, not magic. Software architecture, AI, and systems engineering from the production trenches.

🇪🇸 Cambiar a versión en español: Calculadora de RAM y Disco para Bases Vectoriales RAG (HNSW)

Calculate exact in-memory RAM and NVMe disk sizing for HNSW vector databases (pgvector, Qdrant, Milvus, Weaviate) and see how fp16, int8 scalar quantization, and binary quantization cut cloud RAM bills.

Hot Vector + HNSW Graph RAM8.1 GB
Recommended Node RAM (+25% OS)10.1 GB
NVMe Storage (Vectors + WAL/Meta)1.4 GB
RAM Saved vs Float320.0%
Float32 vector storage dominates RAM; switch to fp16 or int8 to cut memory cost.

Quantization Sizing Breakdown for Your Dataset

Memory FormatBytes/dimHot HNSW + Vector RAMRecommended Node RAMSavings vs fp32

HNSW Graph & Embedding Memory Formula

Following pgvector (PostgreSQL HNSW & halfvec) and the Hierarchical Navigable Small World (HNSW) graph design, keeping the index inside hot RAM avoids catastrophic random SSD page faults:

Vector Bytes = N × D × Precision_Bytes

HNSW Graph Overhead ≈ N × (M × 2 × 4 bytes) × 1.08

Frequently Asked Questions

Why doesn't binary quantization make HNSW memory 32× smaller overall?

Because shrinking vector coordinates by 32× leaves the bidirectional HNSW adjacency pointers (M × 2 × 4B per node) untouched, making graph topology links the dominant share of hot RAM.

How much recall is lost moving from float32 to halfvec (fp16) or int8?

Switching to fp16 cuts vector RAM in half with typically <0.1% recall drop, while int8 and binary quantization achieve high accuracy when paired with oversampling + SSD rescoring on top candidates.

Sizing Disclaimer: Local client-side calculation for capacity planning. Always allocate sufficient maintenance_work_mem in pgvector during index builds to avoid slow disk spills.
Suscribirse Subscribe