Generated banner for Qdrant Memory Usage Optimization
Generated logo for Qdrant Memory Usage Optimization

Qdrant Memory Usage Optimization

GitHubOfficialFirst committed by anush008Distributed by GitHub

  • Skill
  • Tool integration
  • Data and AI
  • MIT
  • No issues found

From the author

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.
— the description by anush008

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

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/github/qdrant-memory-usage-optimization/download
  2. Unzip 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=true and 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 /metrics endpoint. 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 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_scorer config, which enables support of io_uring for parallel disk access, which can significantly improve performance of on-disk storage. Read more about async_scorer in 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.md

Attribution

This folder is an unmodified copy of the Agent Skill "qdrant-memory-usage-optimization", distributed by AutoGineer (https://autogineer.com/agent-skills).

The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.

Files added by AutoGineer

  • ATTRIBUTION.md: this file, written by AutoGineer

  • LICENSE: copied from LICENSE

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
GitHub avatar of anush008anush008
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