Dify Stack Presets
Replacing Weaviate With pgvector on 8 GB Dify VPS Nodes
Reclaim 920 MB to 2.2 GB of instant baseline RAM by switching Dify default Docker Compose from Weaviate to unified pgvector.
-1.1 GB Baseline RSS · Single DB Backup · 8 GB Safe
The Hidden Cost of Default Weaviate
Dify ships Weaviate as a default profile option, which spawns a separate Go/vector process that allocates significant heap even when knowledge bases are small. On an 8 GB KVM 2 VPS, that single container consumes 15% of total machine RAM.
Clean Migration Path
Setting VECTOR_STORE=pgvector in .env lets the existing Postgres container store HNSW indexes natively, freeing over 1 GB for Celery ingestion bursts.
Measured Thresholds & Container Limits
| Metric | Weaviate Default | pgvector Unified |
|---|---|---|
| Idle Vector Container RAM | 920 - 1,450 MB | 0 MB extra (inside db) |
| 50k Chunk RAM Footprint | ~1.9 GB Weaviate + 450 MB DB | ~1.15 GB combined Postgres |
| Backup & Snapshot Simplicity | 2 separate volume snapshots | Single pg_dump / volume |
| Recommended Cutoff | >= 150k vectors or hybrid BM25 | 1k - 140k chunks on 8-16 GB VPS |