Trying Out Cost-Optimized Vector Storage with OpenSearch 3.9 + OI2 on Amazon OpenSearch Service

Trying Out Cost-Optimized Vector Storage with OpenSearch 3.9 + OI2 on Amazon OpenSearch Service

half_float cut index size by 47.5%, and k-NN search and writes worked on an index moved to warm. on_disk 32x recall was 0.834 with rescoring and 0.278 without. Results use 50,000 synthetic vectors.
2026.11.30

This page has been translated by machine translation. View original

Introduction

On November 29, 2026, cost-optimized vector storage for Amazon OpenSearch Service was announced.

https://aws.amazon.com/jp/about-aws/whats-new/2026/11/opensearch-trillion-scale-vectors/

Cost-optimized vector storage is a feature that lets you search ever-growing vectors while keeping them in low-cost storage. This article introduces how to configure it and the results of trying it on small-scale synthetic data.

Test environment

  • Region: Tokyo (ap-northeast-1)
  • OpenSearch: 3.9
  • Features tested: half_float, writable warm, on_disk 32x with rescoring, memory-optimized search
  • Indexes: t-float (float), t-half (half_float), t-disk32 (on_disk 32x), t-memopt (memory-optimized search)
  • Data: 50,000 synthetic vectors, 384-dimensional unit vectors
  • Queries: 100 queries, k=10
  • Ingestion: Vector values were rounded to 5 decimal places and ingested via bulk, then forcemerge max_num_segments=1 was run
  • Number of shards: 1
  • Number of replicas: 0
  • refresh_interval: -1
  • space_type: l2
  • method: t-float, t-half, and t-memopt use faiss HNSW (ef_construction 128, m 16). t-disk32 was created without specifying a method, with mode set to on_disk

The synthetic vectors were created by adding noise to one of 100 cluster centers and normalizing. The ground-truth neighbors for recall were obtained by exact search with numpy. The generation code is as follows.

Data generation code
import numpy as np

N, D, NQ, K = 50000, 384, 100, 10

def make_data():
    rng = np.random.default_rng(42)
    centers = rng.normal(size=(100, D)).astype("float32")
    def gen(n):
        c = centers[rng.integers(0, 100, n)]
        x = c + rng.normal(scale=1.0, size=(n, D)).astype("float32")
        return (x / np.linalg.norm(x, axis=1, keepdims=True)).astype("float32")
    return gen(N), gen(NQ)

def ground_truth(base, q):
    # Exact L2 neighbors (same as descending inner product since these are unit vectors)
    sims = q @ base.T
    return np.argsort(-sims, axis=1)[:, :K]

Creating the domain

The OpenSearch 3.9 OI2 domain was created with the following command. The configuration is one hot node, two warm nodes (both oi2.large.search), and three dedicated master nodes (m7g.large.search). A domain with warm enabled requires dedicated master nodes, and the number of warm nodes is specified in the range of 2 to 150.

ACC=<ACCOUNT_ID>
aws opensearch create-domain \
  --domain-name vec-tier-verify \
  --engine-version OpenSearch_3.9 \
  --cluster-config InstanceCount=1,InstanceType=oi2.large.search,DedicatedMasterEnabled=true,DedicatedMasterType=m7g.large.search,DedicatedMasterCount=3,WarmEnabled=true,WarmCount=2,WarmType=oi2.large.search \
  --node-to-node-encryption-options Enabled=true \
  --encryption-at-rest-options Enabled=true \
  --domain-endpoint-options EnforceHTTPS=true,TLSSecurityPolicy=Policy-Min-TLS-1-2-2019-07 \
  --access-policies "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::${ACC}:role/<ROLE_NAME>\"},\"Action\":\"es:*\",\"Resource\":\"arn:aws:es:ap-northeast-1:${ACC}:domain/vec-tier-verify/*\"}]}" \
  --region ap-northeast-1

Creation took about 11 minutes.

Configuration and operations

The following requests are executed against the domain endpoint.

half_float

To store vectors in half precision, specify half_float for the data_type of knn_vector.

PUT t-half
{
  "settings": {
    "index.knn": true,
    "number_of_shards": 1,
    "number_of_replicas": 0,
    "refresh_interval": "-1"
  },
  "mappings": {
    "properties": {
      "v": {
        "type": "knn_vector",
        "dimension": 384,
        "space_type": "l2",
        "data_type": "half_float",
        "method": {
          "name": "hnsw",
          "engine": "faiss",
          "parameters": {
            "ef_construction": 128,
            "m": 16
          }
        }
      }
    }
  }
}

The value range of half_float and the quantization with bf16, 2 bit, and 4 bit are summarized in the following article.

https://dev.classmethod.jp/articles/opensearch-3-9-vector-compression-base64/

on_disk (32x)

To use 1-bit compression, specify on_disk for the mode of knn_vector and 32x for compression_level. 32x is a compression ratio that reduces float's 32 bits to 1 bit, and corresponds to the 1-bit compression in the announcement.

PUT t-disk32
{
  "settings": {
    "index.knn": true,
    "number_of_shards": 1,
    "number_of_replicas": 0,
    "refresh_interval": "-1"
  },
  "mappings": {
    "properties": {
      "v": {
        "type": "knn_vector",
        "dimension": 384,
        "space_type": "l2",
        "mode": "on_disk",
        "compression_level": "32x"
      }
    }
  }
}

With on_disk, rescoring is enabled by default. To disable it, specify rescore: false inside the target field of the knn query in the search request (here, v). Put the 384-dimensional query vector in vector.

POST t-disk32/_search
{
  "size": 10,
  "_source": false,
  "query": {
    "knn": {
      "v": {
        "vector": [<384 個の値>],
        "k": 10,
        "rescore": false
      }
    }
  }
}

The on_disk parameters are described in the following documentation.

https://docs.opensearch.org/latest/vector-search/optimizing-storage/disk-based-vector-search/

To enable memory-optimized search, set index.knn.memory_optimized_search in the index settings to true. The other settings are the same as t-float.

PUT t-memopt
{
  "settings": {
    "index.knn": true,
    "number_of_shards": 1,
    "number_of_replicas": 0,
    "refresh_interval": "-1",
    "index.knn.memory_optimized_search": true
  },
  "mappings": {
    "properties": {
      "v": {
        "type": "knn_vector",
        "dimension": 384,
        "space_type": "l2",
        "method": {
          "name": "hnsw",
          "engine": "faiss",
          "parameters": {
            "ef_construction": 128,
            "m": 16
          }
        }
      }
    }
  }
}

https://docs.opensearch.org/latest/vector-search/optimizing-storage/memory-optimized-search/

Migrating to warm

To move a hot index to warm, run the _tier/warm API. The acknowledged in the response indicates that the migration was accepted.

POST /t-half/_tier/warm
{
  "acknowledged": true
}

Check the migration status with the _tier API.

GET /t-half/_tier

For t-half, which is about 85 MB, when I called the _tier API 2 seconds after starting the migration, the state was RUNNING_SHARD_RELOCATION. Within 40 seconds there were no more migrations in progress, and the _tier API began returning HTTP 400 with Index [t-half] has no active migrations. I judged this response to mean the migration was complete.

https://docs.aws.amazon.com/opensearch-service/latest/developerguide/multi-tier-storage.html

Measurement results

Index size

After registering 50,000 documents and running forcemerge, I compared the primary shard sizes (pri.store.size).

Index Size (bytes) Ratio to float Reduction
t-float 161,804,438 100% Baseline
t-half 85,004,536 52.5% 47.5% reduction
t-disk32 88,206,354 54.5% 45.5% reduction

The calculated size of the vectors themselves is 50,000 × 384 × 4 = 76,800,000 bytes for float and 38,400,000 bytes for half_float. The measured value for the whole index, including the HNSW graph and so on, was a 47.5% reduction.

The 32x of on_disk is a compression ratio that reduces the memory required by vectors to 1/32. The full-precision vectors used for rescoring are also stored on disk, and the on-disk size (pri.store.size) was a 45.5% reduction.

recall

I ran 100 queries in sequence against the 50,000 synthetic vectors and obtained recall@10 and took.

Index recall@10 took p50 (ms) took p90 (ms)
t-float 0.999 2.0 3.0
t-half 1.000 2.0 2.0
t-disk32 (with rescoring, default) 0.834 2.0 4.0
t-disk32 (without rescoring) 0.278 2.0 2.0

graph_memory_usage

After clearing the cache of all four indexes, I ran 5 queries against t-float only. I checked the k-NN stat graph_memory_usage and the took of the 5 queries. I repeated the same procedure with t-memopt. graph_memory_usage is the amount of native memory the node is using for native library indexes, in KB.

POST /_plugins/_knn/clear_cache/t-float,t-half,t-disk32,t-memopt
GET /_plugins/_knn/stats?stat=graph_memory_usage,graph_query_requests
Index memory_optimized_search graph_memory_usage after search (KB) took of 5 queries after cache clear (ms)
t-float false 82,436 32, 2, 2, 1, 1
t-memopt true 0 1, 1, 1, 1, 1

Search and writes on warm

When I moved t-half to warm, number_of_replicas, which was 0 on hot, changed to 1, and the primary shard and the replica shard were placed one each on the two warm nodes.

When I placed the roughly 85 MB t-half on warm and ran 100 queries in sequence, recall@10 was 1.000, the same as on hot. The took p50 / p90 was 3.0 / 4.0 ms on warm, compared to 2.0 / 2.0 ms on hot.

I was able to bulk-register 200 documents with new IDs into the index on warm, and the document count after refresh was 50,200.

Pricing

This is an estimate for keeping the domain configuration in this article running for one month (730 hours). Unit prices are Tokyo region on-demand, retrieved from the Pricing API.

Node Count Unit price (USD/hour) One month (730 hours)
OI2 (oi2.large.search; 1 hot, 2 warm) 3 0.3427 About 750 USD
Dedicated master node (m7g.large.search) 3 0.175 About 383 USD

I estimated the number of vectors at which half_float on warm becomes cheaper than float on gp3. The difference per 1 billion vectors is about 430 USD/month, and it equals the fixed cost of two warm nodes (about 500 USD/month) at about 1.16 billion vectors.

Vector count Savings (difference between float on gp3 and half_float on warm) Fixed cost of 2 warm nodes
1 billion About 430 USD/month About 500 USD/month
1.16 billion About 500 USD/month About 500 USD/month
2 billion About 859 USD/month About 500 USD/month

The assumptions for the estimate are as follows.

  • Vectors: 384 dimensions. The size per vector is this test's pri.store.size divided by 50,000 (float 3,236 bytes, half_float 1,700 bytes)
  • Unit prices: gp3 is 0.1464 USD/GB-month, warm Managed Storage is 0.026 USD/GB-month
  • Scope: storage charges only. Replicas are 0. Dedicated master nodes are excluded because both configurations require them

Summary

I was able to try cost-optimized vector storage for Amazon OpenSearch Service.

If you have a workload where the data volume keeps growing in proportion to elapsed time, such as vectorized time-series data, and the cost of the storage holding the vector data is an issue, please try cost-optimized vector storage on OpenSearch 3.9 OI2 instances.

Share this article

AWSのお困り事はクラスメソッドへ