qdrant-memory-usage-optimization
它能做什么
这个工具可以帮你了解并降低 Qdrant 的内存占用。它会找出占用内存最多的部分,并提出优化方法,比如压缩数据,或把不常用的部分移到硬盘上。
适用场景
- ✓当 Qdrant 占用过多内存时。
- ✓当 Qdrant 因内存不足而崩溃时。
- ✓当内存占用情况与你的预期不符时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/qdrant-performance-optimization/memory-usage-optimization/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我该如何降低 Qdrant 的内存占用?”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会分析 Qdrant 如何使用内存(包括 RAM 和系统缓存),检查哪些组件(比如索引或向量)占用最多。基于分析结果,它会建议使用更小的数据格式,或把很少访问的数据移到硬盘上等方法。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
常见问题
常驻内存(RSSAnon)和操作系统页缓存有什么区别?
常驻内存是 Qdrant 存放核心数据所使用的 RAM。操作系统页缓存同样是 RAM,用来加快磁盘读取,必要时可以被释放。
什么时候应该把 HNSW 索引放到硬盘上?
适用于以下情况:你使用的是高速硬盘(NVMe),有大量“租户”(用户或客户端)但同一时间只访问其中少数,或者启用了 inline storage。
降低内存占用的主要方法有哪些?
使用量化(quantization)压缩向量,选择更小的数据类型(float16、int8),用 Matryoshka 把大型向量保存在硬盘上,并配置索引和稀疏向量存放在硬盘上。
详情
作者的原始描述
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 nodes crash during recovery.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7361
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。