qdrant-memory-usage-optimization
关于
This skill diagnoses and reduces Qdrant memory usage by analyzing resident memory versus OS page cache. It helps when RAM is high, nodes crash, or memory doesn't match calculations. The skill provides optimization strategies for scenarios like excessive resident memory or failed quantization attempts.
快速安装
Claude Code
推荐npx skills add qdrant/skills -a claude-code/plugin add https://github.com/qdrant/skillsgit clone https://github.com/qdrant/skills.git ~/.claude/skills/qdrant-memory-usage-optimization在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
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.
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
GitHub 仓库
相关推荐技能
railway-docs
文档Railway Docs Skill可实时获取最新的Railway官方文档,确保回答的准确性。当开发者询问Railway功能特性、工作原理或分享docs.railway.com链接时,应优先使用此技能。它通过专门的LLM优化文档源提供最新信息,避免依赖过时记忆来回答技术问题。
n8n-code-python
文档该Skill为在n8n平台的Python代码节点中编写代码提供专家指导,特别适用于需要使用_input/_json/_node语法、Python标准库或了解n8n中Python限制的场景。它强调JavaScript应作为首选方案,仅当需要特定Python功能或对Python语法更熟悉时才使用Python。Skill提供了快速入门模板和关键注意事项,帮助开发者在n8n中高效编写Python代码。
archon
文档Archon Skill为开发者提供了基于RAG的语义搜索和项目任务管理功能,可通过REST API访问知识库。它支持文档搜索、网站爬取、文件上传和版本控制,适用于技术文档查询和项目管理场景。首次使用时需要配置Archon主机地址,建议在处理外部文档时优先使用该Skill。
n8n-code-javascript
文档这个Skill为n8n工作流中的JavaScript代码节点提供专业指导,涵盖数据处理、HTTP请求和日期操作等核心场景。它详细解释了如何正确使用n8n特有的`$input`/`$json`语法、`$helpers`工具以及DateTime对象,并包含关键的错误排查和模式选择建议。开发者通过该Skill能快速掌握Code节点的正确返回格式、数据访问方法和常见陷阱解决方案。
