Error Diagnostics // NodeFlow Diagnostics
Qdrant & pgvector HNSW Index OOM During Bulk Upsert
Co-locating Qdrant or pgvector on the same VPS as FlowiseAI/Langflow causes silent memory spikes when building HNSW graphs for 1536d or 3072d embeddings.
Measured Stack Telemetry & Memory Profile
Every 100,000 1536-dimensional Float32 vectors occupies ~614 MB raw plus ~400-700 MB for HNSW graph links in RAM. Building HNSW indexes inside pgvector with maintenance_work_mem too small stalls ingestion, while Qdrant without on_disk_payload holds all metadata in RAM.
| Subsystem / Signal | Measured Target | Operational Impact |
|---|---|---|
| 100k x 1536d Vector Footprint | ~1.1 - 1.4 GB RAM | With in-memory HNSW edges + payload |
| Qdrant On-Disk Threshold | on_disk: true (vectors) | Cuts RAM usage 60-75% on NVMe VPS |
| Recommended Upsert Batch | 100 - 250 chunks/call | Prevents payload JSON spikes in Node/Python |
Step-by-Step Triage & Config Remediation
- Enable Qdrant disk-backed payloads: Set on_disk_payload: true and memmap_threshold_kb in Qdrant collection config on NVMe SSDs.
- Tune pgvector maintenance_work_mem: Allocate 512MB-1GB maintenance_work_mem in Postgres when indexing >50k chunks.
- Cap upsert chunk batch size: Stream upserts in 100-250 chunk slices instead of sending 10,000 chunks in one HTTP call.
# Postgres pgvector tuning for 16 GB KVM 4 shared_buffers = 2GB maintenance_work_mem = 768MB work_mem = 32MB
Diagnostic FAQ
Is Qdrant fast when vectors or payloads live on disk?
On Hostinger KVM NVMe storage, mmap-backed Qdrant payloads deliver single-digit millisecond filtering with a fraction of the RAM.
Can I keep pgvector and Flowise on one 8 GB KVM 2?
Yes, up to ~50k chunks and 2,500 PDF pages with --max-old-space-size=4096.