qdrant-indexing-performance-optimization
它能做什么
这个工具可以帮你找出并解决让 Qdrant 数据索引和写入变得非常缓慢的问题,并提出调整建议,以加快数据上传和搜索。
适用场景
- ✓当上传数据到 Qdrant 耗时过长时。
- ✓当索引优化过程卡住或耗时过多时。
- ✓当 HNSW 索引(一种用于快速搜索的索引类型)的构建非常缓慢时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/qdrant-performance-optimization/indexing-performance-optimization/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 Qdrant 索引速度非常慢,我该怎么办?”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会分析问题出在你的电脑或网络上,还是出在 Qdrant 服务器上。然后建议你分批上传数据,并调整 Qdrant 的配置,比如分片(shards)数量和索引策略,以加快整个过程。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
What to Do When Qdrant Indexing Is Too Slow
Qdrant does NOT build HNSW indexes immediately. Small segments use brute-force until they exceed indexing_threshold_kb (default: 20 MB). Search during this window is slower by design, not a bug.
- Understand the indexing optimizer Indexing optimizer
Uploads/Ingestion Too Slow
Use when: upload or upsert API calls are slow. Identify bottleneck: client-side (network, batching) vs server-side (CPU, disk I/O)
For client-side, optimize batching and parallelism:
- Use batch upserts (64-256 points per request) Points API
- Use 2-4 parallel upload streams
For server-side, optimize Qdrant configuration and indexing strategy:
- Create more shards (3-12), each shard has an independent update worker Sharding
- Create payload indexes before HNSW builds (needed for filterable vector index) Payload index
Suitable for initial bulk load of large datasets:
- Disable HNSW during bulk load (set
indexing_threshold_kbvery high, restore after) Collection params - Setting
m=0to disable HNSW is legacy, use highindexing_threshold_kbinstead
Careful, fast unindexed upload might temporarily use more RAM and degrade search performance until optimizer catches up.
See https://search.qdrant.tech/md/documentation/tutorials-develop/bulk-upload/
Optimizer Stuck or Taking Too Long
Use when: optimizer running for hours, not finishing.
- Check actual progress via optimizations endpoint (v1.17+) Optimization monitoring
- Large merges and HNSW rebuilds legitimately take hours on big datasets
- Check CPU and disk I/O (HNSW is CPU-bound, merging is I/O-bound, HDD is not viable)
- If
optimizer_statusshows an error, check logs for disk full or corrupted segments
HNSW Build Time Too High
Use when: HNSW index build dominates total indexing time.
- Reduce
m(default 16, good for most cases, 32+ rarely needed) HNSW params - Reduce
ef_construct(100-200 sufficient) HNSW config - Keep
max_indexing_threadsproportional to CPU cores Configuration - Use GPU for indexing GPU indexing
HNSW index for multi-tenant collections
If you have a multi-tenant use case where all data is split by some payload field (e.g. tenant_id), you can avoid building a global HNSW index and instead rely on payload_m to build HNSW index only for subsets of data.
Skipping global HNSW index can significantly reduce indexing time.
See Multi-tenant collections for details.
Additional Payload Indexes Are Too Slow
Qdrant builds extra HNSW links for all payload indexes to ensure that quality of filtered vector search does not degrade.
Some payload indexes (e.g. text fields with long texts) can have a very high number of unique values per point, which can lead to long HNSW build time.
You can disable building extra HNSW links for specific payload index and instead rely on slightly slower query-time strategies like ACORN.
Read more about disabling extra HNSW links in documentation
Read more about ACORN in documentation
What NOT to Do
- Do not create payload indexes AFTER HNSW is built (breaks filterable vector index)
- Do not use
m=0for bulk uploads into an existing collection, it might drop the existing HNSW and cause long reindexing - Do not upload one point at a time (per-request overhead dominates)
常见问题
为什么数据在建立索引时搜索会变慢?
Qdrant 不会立即构建 HNSW 索引。对于较小的数据块,它会使用更简单、更快的方法,但这样搜索会更慢。当数据量达到一定规模或完成优化后,情况就会改变。
分片(shards)是什么?它有什么作用?
分片可以理解为数据的划分。分片越多,Qdrant 就能并行处理更新和索引,从而加快整体进度。
应该在 HNSW 之前还是之后创建 payload 索引(载荷索引)?
建议先创建 payload 索引(与数据关联的附加信息的索引),再构建 HNSW 索引。这样可以确保过滤搜索正常工作,也能优化总的索引时间。
详情
作者的原始描述
Diagnoses and fixes slow Qdrant indexing and data ingestion. Use when someone reports 'uploads are slow', 'indexing takes forever', 'optimizer is stuck', 'HNSW build time too long', or 'data uploaded but search is bad'. Also use when optimizer status shows errors, segments won't merge, or indexing threshold questions arise.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7360
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。