qdrant-memory-usage-optimization
できること
このツールは、Qdrantのメモリ使用量を把握し、減らすのに役立ちます。どの部分が最も多くのメモリを使っているかを特定し、データの圧縮や、あまり使われない部分のディスクへの移動などの最適化方法を提案します。
使う場面
- ✓Qdrantが多くのRAMを使っているとき。
- ✓メモリ不足でQdrantがクラッシュするとき。
- ✓メモリ使用量が想定と合わないとき。
スキルのリンク
https://github.com/github/awesome-copilot/blob/main/skills/qdrant-performance-optimization/memory-usage-optimization/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。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)とOSのページキャッシュの違いは何ですか?
常駐メモリは、Qdrantが必要とする重要なデータに使われるRAMです。OSのページキャッシュは、ディスクの読み取りを速くするために使われるRAMで、必要に応じて解放できます。
HNSWインデックスはいつディスクに置くべきですか?
高速なディスク(NVMe)を使える場合、多くのテナント(ユーザーやクライアント)がいて同時に少数しかアクセスしない場合、または「インラインストレージ」が有効な場合に向いています。
メモリ使用量を減らす主な方法は何ですか?
ベクトルを圧縮する量子化を使う、より小さいデータ型(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プロジェクトの評価ポリシーの策定や適用を支援できるようにします。プロジェクトの評価方法を標準化し、コンプライアンスを確保するのに役立ちます。
似ているスキル
discrawl
394k保存済みのローカルなDiscordメッセージのアーカイブを検索して要約し、その新しさを確認し、ダイレクトメッセージを読めるようエージェントを支援します。
clickhouse-io
280kエージェントがClickHouseデータベースのクエリとスキーマを最適化できるようにします。高性能な分析処理向けのベストプラクティスを適用します。分析クエリが遅すぎるときに使います。
scientific-db-pubmed-database
280kエージェントが生物医学分野の科学論文を検索するのに役立ちます。特定の医療情報が必要な研究に便利です。