OpenSearch disk-based vector search for low-memory clusters

OpenSearch's on_disk mode lowers vector memory by default 32x compression and rescores with full-precision vectors from disk. This page explains when it fits a low-memory cluster and what to test before you adopt it.

On this page

When disk-based vector search fits a low-memory OpenSearch cluster

If your k-NN vector index no longer fits in node memory and you cannot add nodes or memory on short notice, on_disk mode is the built-in OpenSearch option for reducing vector memory. Introduced in OpenSearch 2.17, it is enabled per vector field with mode: on_disk and uses a default 32x compression level, so the compressed vectors held in memory are a fraction of the full-precision size. It is the first control to evaluate before you resize hardware, because it changes the index configuration rather than the cluster topology.

It fits best when recall requirements are moderate, query latency has some headroom, and the vector field is one of several contributors to memory pressure. Check three things before you commit: whether your current index already holds full-precision vectors in memory, how many vectors and dimensions you expect at growth, and whether your latency budget tolerates an extra disk read phase. Measure a representative index on a non-production cluster first, because the savings depend on your vector dimensions, document count and the rest of the workload on those nodes, and the product documentation at the OpenSearch disk-based vector search page describes the supported configuration.

It is a poor fit when your queries need the lowest possible latency at high throughput, or when the disk on your data nodes is slow, shared or constrained. Confirm with your OpenSearch version and engine choice that the setup you plan is supported, and ask your team to record baseline recall and latency so you can judge the trade-off with numbers from your own data rather than assumptions. Plan the rollout as a change you can reverse by reindexing, and document who approves the latency impact before production traffic moves.

Configuration options and when each fits

This table compares the default on_disk setup with an in-memory k-NN configuration and shows how the compression level changes memory use and rescoring work. Read each row as a decision: the trade-off column names what you gain in memory and what you pay in latency. Confirm the supported compression levels and engine combinations for your OpenSearch version before you size a cluster.

OptionDefault settingsWhat it tradesWhen it suits a workload
On_disk mode (default)mode on_disk, Faiss engine, HNSW method, 32x compressionLargest memory reduction; two-phase search adds rescoring latency from diskLarge vector sets on memory-constrained nodes where some added latency is acceptable
In-memory k-NN (no on_disk)Standard in-memory HNSW graph with full-precision vectorsLowest query latency; full vector memory footprint on every data nodeSmaller datasets or latency-sensitive queries where the heap and RAM budget can hold the graph
Lower compression level (for example 2x or 4x)Set with the compression_level parameter alongside on_diskLess memory saved than 32x; usually better recall and smaller rescoring workloadDatasets where recall must stay close to in-memory results and memory is adequate but tight
Default 32x compression levelBinary quantized index first, full-precision rescoring from diskGreatest memory savings; more reliance on rescoring to recover accuracyVery large corpora where memory cost dominates and the team has measured recall on its own data
Non-default engine or methodEngine and method must be set explicitly if they differ from the defaultsEngine and method combinations change which compression levels are availableOnly after confirming in the OpenSearch vector search docs that the combination supports on_disk for your version
Rescoring oversamplingControlled by the search-time rescore settingMore candidates rescored raises recall and latency togetherTune after baseline recall and latency tests on representative queries

Where the latency cost and recall trade-offs show up

Disk-based search trades memory for work at query time. The cards below are the places where that trade shows up, and each one needs a measurement on your own data, hardware and query mix before you settle on a configuration.

Added query latency from rescoring

Each search runs in two phases: the compressed index returns candidates first, then full-precision vectors are read from disk to rescore them. That second phase is the source of the extra latency. Measure p50 and p95 latency at your expected concurrency with on_disk enabled and with an in-memory baseline, using your real query vectors and your k value, since a larger k means more full-precision reads.

Disk-based search docs

Dependence on disk speed

Because rescoring reads full-precision vectors from disk, storage performance sets much of the latency. Local NVMe, network block storage and shared file systems behave very differently under random reads. Ask your infrastructure team for the measured random read latency and IOPS of the volumes that will hold the data nodes, and benchmark on the same storage class you plan to run in production, not on a development volume.

Effect on recall

Compression lowers the precision of the first-phase candidate list, so the set that rescoring sees may miss some true nearest neighbors. Whether that matters depends on your application. Build a labeled set of queries with known good results from your own corpus, run the same set against the memory-resident and disk-based configurations, and compare recall at your chosen k before you accept the compression level.

Index build and reindex time

Indexing still computes compressed vectors and builds the HNSW graph, and the rescoring design adds work to ingestion and to any reindex you run later. Measure indexing throughput and total time to load your full corpus, including refreshes and merges, and plan that time into any migration window or model change that forces you to rebuild the index.

Filtering interactions

Queries that combine vector search with filters can change how many candidates the first phase returns and how many full-precision reads follow. Test your real filter combinations, including selective filters and filters that match most documents, because the latency and recall you measure on unfiltered queries may not hold for the filtered queries your users run.

Shard count and sizing

Shard count and size determine how many graphs each query searches and how much disk each rescoring pass touches on each node. Too many small shards add overhead to every query, and very large shards make recovery and rebalancing slower. Size shards against your data volume and node count, then confirm the result with the same latency and recall tests you ran on a single shard.

How to enable on_disk vector search step by step

This sequence takes a team from confirming version support to choosing a compression level for an on_disk k-NN index, with a recall and memory check at each stage. The result is a measured comparison of an in-memory baseline against a disk-based configuration on your own vectors.

  1. Confirm the OpenSearch version and k-NN plugin support

    Check that the cluster runs an OpenSearch release that includes disk-based vector search, which was introduced in OpenSearch 2.17. Confirm that the k-NN plugin is enabled on every data node, and record the exact version in your test plan so later results can be reproduced. The platform team usually does this check, and the cluster health and plugin list from the nodes is the evidence. Before going further, confirm that your upgrade path matches the maintenance status of the version you run, since a cluster on an unmaintained release will need an upgrade first. Done means you have a written version record and a cluster where the k-NN plugin answers on all data nodes.

  2. Create a test index with on_disk mode

    Create a separate test index with a knn_vector field, setting the mode to on_disk and leaving the engine and method at their defaults, which are Faiss and HNSW. Set the vector dimension to match your embedding model and keep the index settings for knn enabled. Use a test index name that cannot be confused with production, and do not point application traffic at it. The search or data engineering team owns this step, and the output is the stored mapping returned by the index mapping API. Confirm that the field type, dimension and mode match what you intended before you load any data.

  3. Load representative vectors into the index

    Load a sample of production-like vectors that come from the same embedding model, chunking and normalization your application will use. Include a realistic share of metadata fields so that any filters you plan to run are exercised during testing. Keep a copy of the source identifiers and the vectors on a separate system so that you can compute exact nearest neighbors later. Refresh the index and confirm the document count matches what you loaded. Ask your data team how large the representative set needs to be for your recall target, because the size of this sample directly affects how meaningful the later measurements are.

  4. Build a known-good set for recall checks

    Compute exact nearest neighbors for a fixed set of query vectors using a brute-force method outside OpenSearch, and store the top results as the reference answers. This known-good set is what you compare every later configuration against, so it must be built once and frozen. Record the distance metric and the value of k used to produce it. The output is a file of query vectors and expected neighbor identifiers. Without this reference, you can measure latency and memory but cannot say whether results have degraded.

  5. Run baseline queries against an in-memory index

    Create a second index with the same mapping and data, but without on_disk mode, so that the vectors are held in memory as they would be under the default approach. Run the query set against it and record the returned identifiers, the latency percentiles and the recall against your known-good set. Keep the same shard count, replica count and node layout for both indexes so the comparison is fair. Done means you have a baseline table of recall and latency that the disk-based configuration must be measured against.

  6. Measure memory and latency on the disk-based index

    Create the on_disk index with the same data and run the same query set against it. Use the node stats and k-NN statistics to read the memory used by the vector structures on each data node, and compare those numbers with the in-memory baseline. Record latency at the same percentiles as the baseline, because two-phase rescoring with full-precision vectors read from disk adds latency. Check that recall stays close to the baseline before accepting any memory savings. The evidence is a side-by-side table of memory, latency and recall for both indexes, produced under the same load.

  7. Choose the compression level from measured results

    Compare the default compression level against the alternatives your OpenSearch version supports, and select the level that meets your memory budget while keeping recall within the threshold your application needs. Each level changes both memory use and rescoring cost, so repeat the memory, latency and recall measurements for each candidate rather than extrapolating from one. Document the chosen level, the rescoring settings, and the test conditions in a configuration record. Ask your engineering team to confirm the final threshold for recall with the product owners before rollout, because that decision is a business trade-off and not a technical default.

How a disk-based k-NN query moves through the cluster

The query starts at a client and reaches a coordinating node, which fans it out to the data nodes holding the shards. Each data node searches the compressed graph held in memory and returns candidates. The coordinating node then sends those candidates back for rescoring with full-precision vectors read from disk, and only the rescored results go back to the client. Check that the rescoring step is the one that adds latency and that the disk path has enough IOPS for your candidate count.

Query path showing where the memory and disk boundaries add latency.

Security and operational considerations for vector indexes on disk

Vector indexes hold embeddings derived from your documents, so they inherit the sensitivity of the source data. The controls below cover who can query them, how traffic and disk are protected, and how the cluster is watched once full-precision vectors are read from disk during rescoring.

Role-based access to vector indexes

Grant read and search permissions on vector indexes through Security plugin roles, scoped to specific index patterns rather than cluster-wide rights. Use document-level and field-level security to limit which documents and vector-related fields a role can see. Confirm in your environment which roles can run k-NN queries and whether any group can read the raw vector field, since embeddings can be inverted to approximate source content.

Security docs

Field masking for embedding fields

Field masking lets a role receive a document without exposing selected fields, which is useful when the text fields are restricted but search still needs to run against the vector. Test that masked and unmasked roles return consistent hit counts and that rescoring behaves the same for each. Confirm that the roles used by application search services do not inherit access to fields their users cannot see.

TLS for node and client traffic

Enable TLS on both transport traffic between nodes and HTTP traffic from clients so that query vectors, returned documents and rescoring data are encrypted in transit. Disk-based search sends full-precision vectors back from disk during the second phase, so the inter-node path carries more data than a compressed in-memory index. Confirm certificate rotation procedures and which clients, including embedding services, must trust the cluster CA.

Audit logging of vector queries

Enable audit logs to record who issued k-NN searches, against which indexes and when. Audit records help investigate bulk extraction of embeddings, which is the main data exposure risk for a vector store. Decide where logs are shipped, how long they are retained, and who reviews them, and confirm that the log volume is sized for the query rate you expect from application traffic.

Disk encryption and snapshot handling

Full-precision vectors live on disk, so encrypt the data volumes at the storage layer and confirm that snapshot repositories are encrypted and access-controlled as well. Compressed and full-precision copies both count as sensitive data for retention purposes. Confirm with your storage team how volume encryption keys are managed and whether snapshots of these indexes fall under the same deletion schedule as the source documents.

Capacity planning for full-precision vectors

Disk-based search stores full-precision vectors on disk in addition to the compressed index in memory, so disk capacity must cover both plus replicas and snapshots. Size data volumes for the full vector set at its current dimension and expected growth, and keep headroom so that merges and reindexing do not exhaust space. Ask your team to confirm the disk tier and whether it can absorb a rebuild without taking the cluster out of service.

Monitoring disk I/O and node health

Rescoring reads vectors from disk on every query, so disk latency and read throughput become part of search latency. Track disk I/O wait, queue depth, search latency percentiles, JVM heap pressure and node status for data nodes that hold vector shards. Set alerts before disks approach their watermarks, and confirm that a node failure does not leave a vector index with too few replicas to serve queries during recovery.

Questions teams ask before enabling disk-based vector search

What drives the effort and cost of a disk-based vector search pilot?

The main driver is how much of the pilot is your own work versus partner work, and how many decisions must be tested before you trust the result. Effort rises with the number of vector fields, the size and shape of the corpus, how many filter and query patterns must be measured, and how many engine and compression settings you want to compare. Costs have two parts: internal engineering time to prepare data, cluster capacity for the test, and any partner fee for a fixed-scope benchmark. Recurring costs begin only when the setup moves into production. Ask any partner for a written scope that lists the datasets, query sets, recall and latency targets, and the number of configurations tested.

How long does a disk-based vector search benchmark usually take?

Duration depends on the data preparation work, not on the search configuration itself, which is quick to change once the index exists. Teams that already have clean embeddings and a representative query log usually spend most of the time on indexing, repeated runs and analysis. Teams that must generate embeddings, sample documents or build ground-truth results need more time before testing starts. Index build time grows with vector count and dimension, and each compression level or rescoring setting you want to compare means another indexing and query cycle. Ask for a schedule with named milestones rather than a single total, and confirm how many configurations the timeline covers.

What data and test vectors must our team supply for the benchmark?

You need a representative set of vectors produced by the same embedding model you plan to use in production, plus the metadata fields your queries filter on. Include a held-out query set that reflects real user searches, and a way to compute reference nearest neighbors so you can measure recall. Also supply the expected volume of documents, the update and deletion rate, and the latency and recall targets your application needs. Without the production embedding model, results will not transfer. If your data contains personal or regulated content, agree on how it is masked or kept inside your environment before any copy leaves your network.

Can an internal team enable disk-based vector search without outside help?

Often yes, if the team already runs OpenSearch in production and has someone who can read index settings, query profiles and cluster metrics. The configuration itself is small: the index uses the on_disk mode and the default Faiss engine with HNSW, and the compression level is set in the vector field mapping. The harder work is judging recall against your own queries, sizing nodes, and deciding whether rescoring latency fits your service targets. Teams without a benchmark history, or with strict compliance evidence needs, often bring in a partner for the test design and review. Check the official documentation for the version you run before changing any production index.

How does a partner scope a disk-based vector search engagement?

A partner usually starts with discovery: current cluster version, node sizes, vector count, dimension, query patterns, latency and recall targets, and any hosting or compliance constraints. From that, the work is split into defined phases such as a baseline, a comparison of compression levels, a rescoring latency test and a recommendation with an operations runbook. DeployOpen plans and delivers most engagements as fixed-scope work, with scope, deliverables and timelines agreed in writing before work starts, and provides a quote that follows from that written scope. Ongoing tuning or retesting after data growth can be arranged as a retainer.

What is the operational risk of rescoring with full-precision vectors?

The main risk is latency. Disk-based search first runs the compressed index, then rescores candidates using full-precision vectors read from disk, which trades slightly higher latency for large memory savings. Whether that is acceptable depends on your query volume, your p95 or p99 targets, and how many candidates are rescored per query. Storage speed matters because rescoring reads from disk, so test on hardware that matches production. Also watch for recall loss at high compression, and set alerts on query latency after the change goes live.

Do we need to upgrade OpenSearch before using on_disk mode?

Disk-based vector search was introduced in OpenSearch 2.17, so clusters on earlier versions must upgrade before the on_disk mode is available. Check the version you run against the release list before planning, because the OpenSearch project maintains each version for a limited period and receives bug fixes and security patches during maintenance but no new features. Plan the upgrade as its own project with a rollback path, and test your vector index on the target version before moving production traffic. Confirm the exact upgrade method for your cluster in the official migration documentation.

How DeployOpen scopes and delivers OpenSearch vector search

DeployOpen plans and builds self-hosted OpenSearch vector search inside your own cloud accounts, data centers or air-gapped networks. We start from your vector count, dimensions, recall target and memory budget, then decide with you whether on_disk mode, a compression level and rescoring fit the workload.

How we scope

  • Inventory vector count, embedding dimensions, refresh rate and the query latency your application can tolerate.
  • Confirm the OpenSearch version and k-NN engine settings your clusters will run before any index design starts.
  • Agree in writing which compression level, rescoring behavior and recall checks are in scope, and what evidence you receive.

How we build

  • Size data and dedicated nodes for disk-backed vector indexes, including disk throughput and free space on each node.
  • Create test indexes with on_disk mode and compare full-precision and compressed recall against a sample of your real queries.
  • Configure index templates, search pipelines and access roles so vector fields follow the same controls as your other data.

How we hand over

  • Deliver documented index mappings, compression settings and the rescoring query pattern your application team must use.
  • Provide a latency and recall test report with the baseline numbers and the trade-offs your team accepted.
  • Walk your platform and engineering staff through runbooks for reindexing, capacity growth and version upgrades.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after the fixed-scope engagement ends.
  • Re-run recall and latency checks when data volume, embedding model or OpenSearch version changes.
  • Confirm retainer terms, response expectations and the upgrade path in the written agreement before work begins.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.