qdrant-memory-usage-optimization
Diagnoses and reduces Qdrant memory usage. Use when someone reports 'memory too high', 'RAM keeps growing', 'node crashed', 'out of memory', 'memory leak', or asks 'why is memory usage so high?', 'how to reduce RAM?'. Also use when memory doesn't match calculations, quantization didn't help, or node
- 01GitHub stars
- 267
- 02Installs
- New
- 03Files scanned
- 1
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 c3d7b10fb3ed5586… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Understanding memory usage
Qdrant operates with two types of memory:
-
Resident memory (aka RSSAnon) - memory used for internal data structures like the ID tracker, plus components that stay fully in RAM (the
pinnedtier), such as quantized vectors and payload indexes. On Qdrant 1.20 or newer, the ID tracker has its ownmemorytier and can leave resident memory; before 1.20 it was always resident. -
OS page cache - memory used for caching disk reads, which can be released when needed. Original vectors are normally stored in page cache, so the service won't crash if RAM is full, but performance may degrade. This is the
cachedandcoldtiers. See the default tiers for each component, and the legacy settings for Qdrant 1.18 or older.
It is normal for the OS page cache to occupy all available RAM, but if resident memory is above 80% of total RAM, it is a sign of a problem.
Memory usage monitoring
- Qdrant exposes process memory through the
/metricsendpoint. See Monitoring docs. - For a per-collection breakdown of RAM, page cache, and disk use by component, call
GET /collections/{collection_name}/memoryor open the Web UI's Memory tab (v1.18+) Memory usage
How much memory is needed for Qdrant?
Optimal memory usage depends on the use case.
- For regular search scenarios, general guidelines are provided in the Capacity planning docs.
For a detailed breakdown of memory usage at large scale, see Large scale memory usage example.
Count payload indexes and the HNSW graph, not just the vectors: Calculating RAM and disk size lists every component.
Additionally, Qdrant requires some extra memory for optimizations. During optimization, optimized segments are fully loaded into RAM, so it is important to leave enough headroom.
The larger max_segment_size is, the more headroom is needed.
When to put HNSW index on disk
Putting frequently used components (such as HNSW index) on disk might cause significant performance degradation. On Qdrant 1.19 or newer this is set with memory: cold in hnsw_config; on 1.18 or older with hnsw_config.on_disk: true.
There are some scenarios, however, when it can be a good option:
- Deployments with low latency disks - local NVMe or similar.
- Multi-tenant deployments, where only a subset of tenants is frequently accessed, so that only a fraction of data & index is loaded in RAM at a time.
- For deployments with inline storage enabled. On Qdrant 1.20 or newer, inline storage keeps the original vectors only in the HNSW index file, so
hnsw_config.memorydecides their tier andvectors.memoryis ignored for those segments. Unless quantization has its own explicitmemory, quantized vectors arecoldwhen the HNSW index iscoldandpinnedin any other tier, so set it explicitly (for examplepinned) if the index iscoldbut you want the quantized vectors in RAM Inline storage.
How to minimize memory footprint
The main challenge is to put on disk those parts of data, which are rarely accessed. Here are the main techniques to achieve that:
-
Use quantization to store only compressed vectors in RAM. On Qdrant 1.20 or newer, 8-bit TurboQuant (
bits8, 4x compression) is the recommended default over scalar quantization at the same compression (use scalar for the Manhattan metric), and it doesn't rescore by default, unlikebits2,bits1_5, andbits1Quantization docs -
Use float16 or uint8 datatypes to reduce memory usage of vectors by 2x or 4x respectively, with some tradeoff in precision.
uint8only makes sense for vectors already quantized to 0-255. On Qdrant 1.19 or newer, the TurboQuant datatypes replace the original vectors with a compressed form (dense vectors and multivectors, not sparse):turbo4(4 bits/dimension, ~8x, from 1.19),turbo8(~4x, closer tofloat32recall, from 1.20), andturbo16(~2x, from 1.20, closer tofloat32thanfloat16). Any of them can be paired with 1-bit quantization for cheaper rescoring than pairing 1-bit quantization with full-precision vectors. A TurboQuant datatype is not TurboQuant quantization, which keeps the originals and adds a copy. Read more about vector datatypes in documentation -
Leverage Matryoshka Representation Learning (MRL) to store only small vectors in RAM while keeping large vectors on disk. Examples of how to use MRL with Qdrant Cloud inference: MRL docs
-
For multi-tenant deployments with small tenants, vectors might be stored on disk because the same tenant's data is stored together Multitenancy docs
-
For deployments with fast local storage and relatively low requirements for search throughput, it may be possible to store all components of vector store on disk. Read more about the performance implications of on-disk storage in the article
-
For low RAM environments, enable async I/O (
io_uring) for concurrent disk reads, which can significantly improve performance of on-disk storage:storage.performance.io_uring: autoon Qdrant 1.19 or newer (applies to everycoldstructure),async_scorer: trueon 1.18 or older (vector rescoring only). Requires Linux with a kernel that supportsio_uringAsync I/O -
Keep payloads on disk:
memory: coldis the default on Qdrant 1.19 or newer; on 1.18 or older, seton_disk_payload: trueDefault tiers -
Configure payload indexes to be stored on disk:
memory: coldon Qdrant 1.19 or newer,on_disk: trueon 1.18 or older docs -
Configure sparse vectors to be stored on disk:
memory: coldon the sparse vector index on Qdrant 1.19 or newer (defaults topinned),on_disk: trueon 1.18 or older docs
Files
1- SKILL.md
bcf6f9463d7.4 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from qdrant/skills8
Qdrant provides client SDKs for various programming languages, allowing easy integration with Qdrant deployments.
Guides Qdrant deployment selection. Use when someone asks 'how to deploy Qdrant', 'Docker vs Cloud', 'local mode', 'embedded Qdrant', 'Qdrant EDGE', 'which deployment option', 'self-hosted vs cloud', or 'need lowest latency deployment'. Also use when choosing between deployment types for a new proje
Guides building on Qdrant Edge, the embedded in-process shard. Use when someone asks 'how to sync Edge with the server', 'keep a local shard in sync with Qdrant Cloud', 'BM25 or keyword search on Edge', 'hybrid search on Edge', 'embeddings on device', 'Edge snapshots', 'apply a partial snapshot', 'w
Diagnoses and guides Qdrant horizontal scaling decisions. Use when someone asks 'vertical or horizontal?', 'how many nodes?', 'how many shards?', 'how to add nodes', 'resharding', 'data doesn't fit', 'need more capacity', 'change replication factor', 'reduce replicas', or 'remove extra replicas'. Al
Setting up and running Qdrant Hybrid Cloud on your own Kubernetes cluster (managed, on-prem, or edge): prerequisites, storage/CSI and backups, installing the Qdrant Cloud agent and operator, creating/exposing/securing clusters, registry mirroring, and secret rotation. Use when someone wants to set u
Explains hybrid search in Qdrant. Use when someone asks 'how do I setup hybrid search?', 'how to combine keyword and semantic search?', 'sparse plus dense vectors?', 'missing keyword matches', 'how to combine results from multiple searches?' and 'combining multiple representations'. Also use for how
Fusing scores from multiple searches into a single ranked result (RRF, DBSF, custom fusion). Use when someone asks 'RRF or DBSF?', 'how to combine sparse and dense', 'how to combine scores from multiple searches?', 'custom fusion', 'fusion is not producing good results', 'how do I tune RRF', 'what k
Constructing prefetch queries for hybrid retrieval, including BM25/dense and multi-field setups, and choosing a lexical retrieval method. Use when someone asks 'dense and sparse in one search?', 'how to combine multiple fields for retrieval?', 'payloads or sparse vectors for lexical?', 'BM25 on a fu
Related backend skillsscan passed
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Point-in-time Run:ai cluster and node-health check: a HEALTHY, DEGRADED, or STUCK verdict per node pool with the dominant blocker — NotReady nodes, offline or failing GPU capacity, GPU counts, allocation vs utilization, the pending backlog, and a stuck scheduler vs a full pool. Use for "is the clust
Operates data delivery and queues in Amazon Kinesis Data Streams (KDS). Covers delivering a stream to Iceberg tables on S3 Tables or to S3 buckets, and queue-based consumption: receive, acknowledge, visibility timeout, and migrating KCL, GetRecords, or Lambda consumers. Applies when records can be p
Report browser/API/CLI/job/worker/webhook bugs. Use for: qa report only, just report bugs, test but dont fix. (gstack)
This skill should be used when the user asks to "build an MCP server", "create an MCP", "make an MCP integration", "wrap an API for Claude", "expose tools to Claude", "make an MCP app", or discusses building something with the Model Context Protocol. It is the entry point for MCP server development
Triage a GKE workload stuck Pending because node provisioning fails with a Compute Engine capacity error (ZONE_RESOURCE_POOL_EXHAUSTED, "GCE out of resources", scale.up.error.out.of.resources) or a quota error (QUOTA_EXCEEDED). Separates resource unavailability from quota limits and configuration ca