Qdrant Memory Usage Optimization
GitHubOfficialFirst committed by anush008Distributed by GitHub
- Skill
- Tool integration
- Data and AI
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to managing memory usage in Qdrant. It explains the distinction between resident memory and OS page cache, offers strategies for monitoring memory via metrics, and outlines various configuration techniques to reduce the RAM footprint. It covers hardware considerations, capacity planning, and specific storage strategies like quantization, data type selection, and offloading components to disk.
What it does
- Explains the difference between resident memory and OS page cache in Qdrant.
- Provides guidance on monitoring memory usage through metrics endpoints.
- Outlines techniques to reduce memory footprint, including quantization and data type selection.
- Details strategies for offloading HNSW indexes, payload, and sparse vectors to disk.
- Discusses capacity planning and headroom requirements for segment optimization.
- Suggests performance configurations like async_scorer for low-RAM environments.
When to use it
- When investigating reports of high memory usage or memory leaks.
- When a Qdrant node crashes due to out-of-memory errors.
- When planning capacity for a new Qdrant deployment.
- When optimizing performance for multi-tenant or low-RAM environments.
- When memory usage does not align with expected calculations.
Advantages
- Helps prevent node crashes and service degradation.
- Provides actionable techniques to balance memory usage and search performance.
- Clarifies the impact of different storage configurations on RAM.
- Supports efficient scaling by identifying components suitable for disk storage.
Usage examples
- “My Qdrant node keeps crashing with OOM errors, how can I reduce RAM usage?”
- The agent will guide you through checking resident memory, evaluating your quantization settings, and considering offloading payload indexes or sparse vectors to disk.
- “How do I decide if I should store my HNSW index on disk?”
- The agent will explain the performance trade-offs and identify specific scenarios, such as using NVMe storage or multi-tenant architectures, where this is appropriate.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/github/qdrant-memory-usage-optimization/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip qdrant-memory-usage-optimization.zip -d .agents/skills
Documentation by anush008
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 must stay in RAM, such as quantized vectors when
always_ram=trueand payload indexes.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.
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 memory usage through the
/metricsendpoint. See Monitoring docs.
<!-- ToDo: Talk about memory usage of each components once API is available -->
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.
Payload indexes and HNSW graph also require memory, along with vectors themselves, so it's important to consider them in calculations.
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. 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.
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 Quantization docs
Use float16 or int8 datatypes to reduce memory usage of vectors by 2x or 4x respectively, with some tradeoff in precision. 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, consider
async_scorerconfig, which enables support ofio_uringfor parallel disk access, which can significantly improve performance of on-disk storage. Read more aboutasync_scorerin the article (only available on Linux with kernel 5.11+)Consider storing Sparse Vectors and text payload on disk, as they are usually more disk-friendly than dense vectors.
Configure payload indexes to be stored on disk docs
Configure sparse vectors to be stored on disk docs
Files
- ATTRIBUTION.mdAdded by AutoGineer922 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md4.7 KiB
LICENSE
MIT License Copyright GitHub, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Requirements and compatibility
Written for: GitHub Copilot
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- First committed by
anush008
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · skills/qdrant-performance-optimization/memory-usage-optimization · commit 797337f
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Contributors
- anush008
AutoGineer is not affiliated with or endorsed by anush008 or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download qdrant-memory-usage-optimization.zip