OpenSearch on dedicated servers

OpenSearch is the Apache 2.0 licensed search and analytics suite, now governed by its own foundation. It thrives on memory and NVMe, which a dedicated machine supplies in generous amounts.

What is OpenSearch used for?

Full-text search for sites and apps, log and event analytics, security monitoring and observability. It indexes JSON documents into Lucene shards, answers search and aggregation queries over a REST API, and comes with OpenSearch Dashboards for visual exploration. The project forked in 2021, is licensed under Apache 2.0, and moved to the OpenSearch Software Foundation under the Linux Foundation in 2024.

How do I prepare the system?

Two kernel and JVM settings matter before the first start. Lucene memory-maps index files, so raise the map count. Then give the JVM a fixed heap: half of memory at most and no more than about 31 GB, so the JVM keeps compressed object pointers. Everything left over becomes file cache, which Lucene uses heavily.

echo "vm.max_map_count=262144" > /etc/sysctl.d/90-opensearch.conf && sysctl --system
# heap file, e.g. jvm.options.d/30g.options
-Xms30g
-Xmx30g

On a 128 GB machine that leaves about 95 GB for the page cache, which keeps hot shards in memory.

How do I set up security?

The security plugin ships with demonstration certificates that must be replaced before production. Generate your own CA, node and admin certificates, set them in opensearch.yml, and apply the security configuration with the admin tool. Recent packages ask for an initial admin password at install time through the OPENSEARCH_INITIAL_ADMIN_PASSWORD variable. Keep port 9200 behind a firewall or a reverse proxy, and port 9300 open only between nodes.

PortUseExposure
9200REST APIApplications and admins only
9300Transport between nodesCluster members over WireGuard
5601OpenSearch DashboardsBehind a proxy with login

How big should shards be?

Between 10 and 50 GB each is the usual target. Too many small shards waste heap, since each has fixed overhead; very large shards recover and relocate slowly. For logs, roll over daily or by size and keep primaries per index to the number of data nodes. A rough guide is to stay below 20 shards per gigabyte of heap on each node.

How do I manage log retention?

With Index State Management policies that move indices through states: hot while written, then read-only and force-merged, then deleted after the retention period. Rollover aliases keep writers pointed at the current index.

PUT _plugins/_ism/policies/logs-30d
{ "policy": { "default_state": "hot", "states": [
  { "name": "hot", "actions": [ { "rollover": { "min_size": "40gb", "min_index_age": "1d" } } ],
    "transitions": [ { "state_name": "warm", "conditions": { "min_index_age": "3d" } } ] },
  { "name": "warm", "actions": [ { "force_merge": { "max_num_segments": 1 } } ],
    "transitions": [ { "state_name": "delete", "conditions": { "min_index_age": "30d" } } ] },
  { "name": "delete", "actions": [ { "delete": {} } ] } ] } }

How many nodes, and which roles?

Three nodes give a resilient cluster: each holds data and is eligible as cluster manager, and every primary shard has a replica on another node. Larger clusters add dedicated data nodes and keep three small cluster-manager nodes. A Storage model with large drives works as a warm node for older, rarely searched indices, while NVMe machines carry the hot tier.

Which machines fit?

RoleMachineWhy
Small cluster nodeESSENTIAL-464 GB DDR4, NVMe
Hot data nodeESSENTIAL-5128 GB DDR4, 24 cores
Large hot nodeESSENTIAL-8256 GB DDR4 for heap and cache
Warm node for old logsSTORAGE-2 20242x 960 GB SSD NVMe (system) + 2x 22 TB HDD SAS, Soft RAID

ESSENTIAL-5 at $120.00 a month suits most hot nodes. Every model has ECC memory, valuable for a system that holds a lot of data in RAM. Our Elasticsearch clusters page covers the original engine, and Typesense search servers and Meilisearch servers cover lighter search engines for site search.

Machines for OpenSearch

Lowest monthly price of each model across its data centres; the model page shows the price in every location.

ModelProcessorCoresMemoryDrivesPortPer month
ESSENTIAL-4AMD EPYC 73131664 GB2x 960 GB SSD NVMe1 Gbps unmetered$106.20
ESSENTIAL-5AMD EPYC 741324128 GB2x 960 GB SSD NVMe1 Gbps unmetered$120.00
ESSENTIAL-8AMD EPYC 753232256 GB2x 480 GB SSD SATA1 Gbps unmetered$126.60
BUSINESS-5 2024AMD EPYC 8224P2496 GB2x 960 GB SSD NVMe3 Gbps unmetered$280.20
STORAGE-2 2024AMD EPYC 4344P832 GB2x 960 GB SSD NVMe + 2x 22 TB HDD SAS3 Gbps unmetered$187.80
ENTERPRISE-a2 2026AMD EPYC TURIN 925524128 GB2x 1.92 TB SSD NVMe5 Gbps unmetered$446.40

Give each node plenty of memory: half for heap up to 31 GB, the rest for file cache.

See all servers and prices

Related pages

Elasticsearch clusters

Run Elasticsearch on bare metal: automatic security on first start, enrollment tokens, node roles and data tiers, lifecycle policies and snapshot repositories.

Read more

Meilisearch servers

Self-host Meilisearch for site and app search: master and API keys, index settings, memory-mapped storage, indexing speed, snapshots and dumps.

Read more

Typesense search servers

Host Typesense, the open-source typo-tolerant search engine: in-memory indexes, port 8108, scoped API keys, three-node Raft clusters and memory sizing.

Read more

Big data and analytics

High core EPYC machines and dense disk chassis for Spark, ClickHouse and data lake clusters.

Read more

Questions and answers

How large should the OpenSearch heap be?

Half of system memory at most and no more than about 31 GB, so the JVM keeps compressed pointers; the rest serves as file cache.

Why does OpenSearch need vm.max_map_count raised?

Lucene memory-maps index files, so the kernel limit is raised to 262144 or more before starting nodes.

How big should OpenSearch shards be?

Usually 10 to 50 GB each, with fewer than about 20 shards per gigabyte of heap on each node.

How do I delete old logs in OpenSearch automatically?

Create an Index State Management policy with rollover, optional force merge and a delete state after the retention period.

What licence does OpenSearch use?

Apache 2.0. The project is governed by the OpenSearch Software Foundation under the Linux Foundation.