OpenSearch JVM heap and Linux settings for production: what to set before go-live
A team putting OpenSearch nodes into production on hosts it controls needs three host-level settings right before go-live, and they decide whether nodes start cleanly and stay stable. The core items are a Java heap at about half of system RAM, vm.max_map_count set to at least 262144, enough /dev/shm space for Performance Analyzer, and an understanding of how the circuit breaker defaults depend on heap size. These apply to every production node, whether the install uses Docker, Helm, the OpenSearch Kubernetes Operator, RPM or Debian packages, or the Ansible playbook. The method changes where the setting lives, not whether it matters.
Set the heap through OPENSEARCH_JAVA_OPTS or the jvm.options file for package installs, and keep the minimum and maximum heap equal so the JVM does not resize under load. Heap should be about half of RAM, leaving the rest for the Lucene file system cache that search and indexing depend on. Set vm.max_map_count on the host itself, not only inside a container, because containers inherit the host kernel value. Confirm the value on every node, including any node added later by autoscaling or an operator resize. The Docker sample file does not set it for you, so check it as a go-live gate rather than assuming the install handled it.
Performance Analyzer writes to /dev/shm, and it can need up to 1 GB, while Docker defaults that mount to 64 MB. On Docker or Kubernetes, enlarge the shared memory mount for each container, or disable Performance Analyzer if you do not use it, and record that choice. The parent circuit breaker defaults to 95 percent of JVM heap when real memory tracking is on and 70 percent when it is off, so heap size directly sets the point where OpenSearch rejects requests to protect the node. Before go-live, confirm the circuit breaker settings in your cluster, test a heavy query against a staging node, and confirm the values with your version's documentation before tuning them.
Host settings and when each choice fits
This table compares the four host-level settings that shape a production OpenSearch node, with the documented recommendation, the factors that move each value, and the mistake teams make most often. Read each row against the hosts you actually run, because the heap and breaker values depend on the memory a node really has.
| Setting | Documented recommendation | What moves the value on a given host | Common mistake |
|---|---|---|---|
| JVM heap | About half of system RAM, per the OpenSearch install docs | Total RAM on the node, other processes sharing the host, and whether the node also runs Dashboards or agents | Setting heap close to all RAM, which leaves little for the filesystem cache that search and indexing rely on |
| vm.max_map_count | At least 262144 on Linux hosts | Number of memory-mapped index files per node, which grows with shard count and segment count | Setting it only for the current session, so it resets after a reboot, or leaving the container host untouched |
| /dev/shm space | Performance Analyzer can need up to 1 GB of shared memory | Whether Performance Analyzer is enabled and the container runtime's shared memory limit | Keeping Docker's default 64 MB /dev/shm, which is below what Performance Analyzer can need |
| Parent circuit breaker | 95 percent of JVM heap with real memory tracking, or 70 percent without it | Whether real memory circuit breaking is enabled and the heap size the breaker percentage applies to | Raising the breaker limit to avoid rejections, which moves the failure into an out-of-memory error instead of a clean rejection |
How to size the JVM heap without starving the host
Heap size is the first memory decision on every OpenSearch node, and it sets how much RAM the operating system keeps for file caching and other processes. The cards below cover the starting point, the host trade-offs, how to verify each node, and how to roll out changes safely.
Start at half of system RAM
OpenSearch recommends a Java heap of half of system RAM as the documented starting point. Set the heap on each node from that node's own memory, not from a template copied across a mixed fleet. Confirm the RAM figure with the platform team before the first deployment, because a VM resize or a changed instance type changes the correct value.
Installation docsLeave memory for the page cache
Lucene relies on the operating system page cache to keep index files in memory, so a heap set too high starves search and indexing performance even when the process looks healthy. Keep the heap at the documented starting point rather than pushing it upward to fit more data. Check cache hit behavior and swap activity during load tests before increasing anything.
Account for shared hosts and containers
On hosts shared with other services, the heap must fit alongside those processes, agents and the Performance Analyzer's use of /dev/shm. In containers, set the heap relative to the container memory limit, not the host total, and confirm the limit is visible to the JVM. Ask the infrastructure team which workloads share each node before sizing.
Confirm the setting on each node
Verify the effective heap on every node, not only in the configuration file, by reading the node stats API or the JVM options the process was started with. Mismatches between the file, the environment variables and the container limit are common after an upgrade. Record the result in your build evidence so the reviewer can see each node matches the plan.
Roll heap changes one node at a time
A heap change takes effect only after the OpenSearch process restarts, so apply it through a rolling restart that keeps the cluster green between nodes. Wait for shard recovery to finish on each node before moving to the next one. Plan the change window with the application owners, since a cluster that cannot recover shards quickly will hold the rollout.
Setting heap, kernel and shared memory on each node
This sequence brings each OpenSearch node to a known baseline: heap sized from the host's RAM, the kernel map count and shared memory set so they survive a reboot, and circuit breakers confirmed before the node joins a cluster. Each step ends with a check you can record.
Inventory RAM and co-located workloads
The platform or systems engineer records total RAM, the number of OpenSearch nodes that will share the host, and every other process that runs there, such as agents, log shippers or other databases. Heap sizing starts from memory the OpenSearch process can actually use, not from the machine's total. Done when the host sheet lists the memory available to each node and nothing else is scheduled to compete with it. If a host runs more than one node or shares memory with other services, confirm the split with your OpenSearch support path before continuing.
Set heap through the install method's JVM options
The engineer sets the Java heap using the mechanism for the chosen install method: a jvm.options override for tarball, RPM and Debian installs, the OPENSEARCH_JAVA_OPTS variable for Docker, or the values your Helm chart, operator resource or Ansible role exposes. OpenSearch recommends a heap of half of system RAM, and the minimum and maximum heap should be set to the same value. Done when the configured heap is written in the deployment definition and the node reports that value at startup. Keep the change in version control so it is reviewed like any other config.
Set vm.max_map_count persistently
On each Linux host, the engineer sets vm.max_map_count to at least 262144 in a sysctl drop-in file, such as /etc/sysctl.d/99-opensearch.conf, and applies it with sysctl --system. Setting it only at the command line works until the next reboot, so the file is the step that counts. For Kubernetes nodes, confirm the same value on the worker host, since the container cannot change it. Done when sysctl -n vm.max_map_count returns 262144 or higher on every node and a reboot test returns the same value.
Size shared memory for Performance Analyzer
Performance Analyzer writes to /dev/shm and can need up to 1 GB of it. On bare-metal or VM hosts, the engineer checks the size with df -h /dev/shm and enlarges the tmpfs mount if it is smaller. For Docker, Docker defaults /dev/shm to 64 MB, so the container needs a shm_size setting or the equivalent in Compose, Kubernetes or the operator. Done when the mount or container shows at least 1 GB available on every node where Performance Analyzer is enabled, and the value is recorded in the deployment file.
Confirm circuit breaker settings
The engineer reviews the cluster settings and the node configuration for any circuit breaker overrides. The parent breaker defaults to 95 percent of JVM heap when real memory tracking is on, and 70 percent when it is off. Record each change that departs from those defaults, the reason for it and who approved it. Done when the cluster settings response shows either default values or a documented override with a reviewer's name. Changes to these breakers should be tested under load before they reach production.
Start the node and check node stats
The engineer starts the node and queries the node stats API to confirm the JVM heap maximum, the heap used percentage and the breaker limits match the plan. The output should show the heap value from step two and the parent breaker limit from step five. Done when the node stats response matches the recorded baseline, and the node has joined the cluster with the expected role. Save this response as the baseline for later comparison.
Review startup logs for memory warnings
The engineer reads the node logs from startup and the first few minutes of traffic, looking for bootstrap check failures, warnings about heap, memory locking or the max map count, and any Performance Analyzer errors about shared memory. Any bootstrap check failure stops the node from being production-ready. Done when the logs contain no memory or bootstrap errors, and the team has filed the baseline stats, the sysctl output and the shared memory check together as the host's record.
How circuit breakers follow heap and why the defaults matter
OpenSearch circuit breakers exist to reject a request before it can exhaust the JVM heap, so the node returns an error instead of running out of memory and failing under load. The most important of them is the parent circuit breaker, which caps the total memory that all other breakers and in-flight work may claim together. Its default is 95 percent of JVM heap when real memory tracking is on, and 70 percent when it is off. These limits are calculated from the heap size you configure, which means the breakers do not protect a fixed amount of memory. They protect whatever fraction of whatever heap you set.
That dependency is where sizing mistakes become failures. If the heap is set too high relative to physical RAM, the operating system has little left for the filesystem cache that Lucene relies on, and the breakers still allow the heap to fill close to its ceiling. If the heap is set too low, the parent breaker trips earlier than the workload expects, and requests fail with circuit breaking exceptions that look like a capacity problem but are really a configuration problem. Before you tune anything in the breaker settings, confirm that the heap matches the guidance in the install documentation and that the host has the memory the heap assumes. Check the current breaker values on each node, and note whether real memory tracking is enabled in your version, because that switch changes the default you are actually running.
Leave the defaults in place unless you can name a documented workload reason to change them, such as a known field data or request pattern that the defaults reject for a reason you have measured. Any change to a breaker limit should be made first in a test cluster built with the same heap, node count and data volume as production, then replayed with realistic queries and bulk loads while you watch heap usage and breaker trip counts. Record the change, the reason and the test result, and review the setting whenever you change heap size or upgrade, since the defaults are relative to heap. The Circuit breaker settings reference lists each breaker and the setting that controls it, and it is the right place to confirm the current behavior for your version.
Security and operational risks of getting host settings wrong
Host settings fail in quiet ways: a node may refuse to start, run slowly under load, or lose diagnostic data without an obvious error. The cards below cover the operational failures to plan for and the security exposure created by the files and memory that OpenSearch writes on each host.
Nodes that fail to bootstrap
A node started with a low vm.max_map_count can fail its bootstrap checks and never join the cluster. The OpenSearch install docs recommend a value of at least 262144 on Linux hosts. Check the value on every node before first start, and confirm that the setting is applied at boot, not only in the current session.
Installing OpenSearch docsMemory-mapped file errors under load
OpenSearch stores index segments in memory-mapped files. When the kernel map limit is reached as shards grow, nodes can start rejecting writes or failing merges under load, even though the cluster looked healthy at startup. Track map counts as data volume grows, and treat the limit as a capacity planning input rather than a one-time fix.
Performance Analyzer gaps
Performance Analyzer writes its metrics through /dev/shm, and Docker defaults that mount to 64 MB, which can be too small. When the space runs out, metrics go missing without stopping the cluster, so dashboards show gaps exactly when you need them. Confirm the mount size on each container or host and monitor whether the metrics stream is still arriving.
- Possible /dev/shm need
- 1 GB
Swapping that degrades latency
When the operating system swaps out heap pages, garbage collection pauses stretch and query latency becomes unpredictable. The heap should be sized at about half of system RAM so the rest is left to the file system cache that search depends on. Disable swap or lock memory on the nodes, and watch for swap activity during reindexing and snapshot jobs.
Settings that drift or disappear
Host settings set by hand on one node are often missing on the next. A container rebuild, a new VM image or an autoscaled node can restart with the defaults, and the parent circuit breaker and heap sizing then change without a deployment record. Define these values in configuration management or the deployment manifest, and compare them across all nodes after each rebuild.
Heap dumps and diagnostics as sensitive data
A heap dump captures what was in memory at the time, which can include documents, query text, credentials and session data. Performance Analyzer metrics and shared memory contents need the same care. Restrict read access to the data and log directories, set a retention limit on dumps, and apply the same access controls and encryption you use for indexed data before sharing them with vendors or support teams.
Questions teams ask before changing host settings
Can an internal platform engineer make these host changes without outside help?
Yes, in most environments an internal platform engineer can make these changes, provided they have root or equivalent access to each node and understand how the OpenSearch service reads its configuration. The work itself is small: setting the JVM heap to about half of system RAM, raising vm.max_map_count to at least 262144, and sizing /dev/shm where Performance Analyzer runs. The harder part is proving the settings persist across reboots and redeployments, and that every node matches. Outside help is most useful when the cluster is large, the team is new to OpenSearch, or the change must be documented for an external assessment. Ask whether your team has the capacity to test each node after a restart, not just whether it can edit a file.
How long does a rolling host settings change take per node?
A rolling change moves through the cluster one node at a time, so the total time grows with node count and with how long each node takes to restart and rejoin. Each step generally involves draining or isolating the node, applying the change, restarting OpenSearch, waiting for the node to rejoin, and confirming cluster health returns to green before moving on. Heap and kernel changes both usually require a service restart, and a restart on a large data node can take longer to recover shards than on a small node. Ask your team to measure one node in a test environment first, then multiply by the node count and add time for health checks, rollback planning and change approval.
What makes the effort for host settings work larger?
Effort rises mainly with the number of nodes, the number of ways those nodes were deployed, and the amount of evidence required. A cluster of a few nodes on identical virtual machines is a short task. Effort increases when the estate mixes bare-metal hosts, virtual machines and containers, because each platform sets heap, kernel parameters and shared memory differently. In containers, vm.max_map_count is set on the host, not inside the container, and Docker's default /dev/shm size of 64 MB is below the 1 GB Performance Analyzer can need. Compliance evidence adds work too: change records, configuration baselines and proof that each node was verified. Ask for an inventory of node count, deployment methods and any evidence your assessors expect before estimating.
What does the team need to provide before host settings work starts?
The team needs to provide access and information before any change is planned. That means administrative access to each host or a pipeline that can apply configuration, a current copy of the OpenSearch configuration and JVM options files, the deployment method for each node, and a list of the RAM each node has. Change windows must be agreed with the teams that own the workloads, along with a rollback plan. If the cluster is in production, the team should also provide current cluster health output and recent monitoring data so the baseline is known. Confirm which people can approve the change and who will be on call during it.
Can these settings be changed on a running cluster?
Settings on a running cluster are changed node by node, not all at once, and most host-level changes require restarting the OpenSearch process on that node. The heap size is set in the JVM options and takes effect on restart, so it cannot be changed live. The vm.max_map_count value is a kernel setting and can be changed on the host, but it should be persisted in system configuration so it survives reboots. The circuit breaker limits are dynamic cluster settings in many cases, but they are tied to heap size, so changing heap changes what those limits protect. Keep the cluster in a healthy state between nodes and do not restart more than one node at a time unless your replica and allocation settings allow it. Confirm the exact behavior for your OpenSearch version in the install documentation.
What should a quote for host settings work include?
A quote should follow from a written scope that lists each node, its deployment method, the settings to change and the verification steps. Ask for the work to be broken into one-time items, such as the initial audit, configuration changes, test runs and documentation, and recurring items, such as checks after upgrades or new nodes. The quote should name who performs each step, what the client must provide, how change windows are handled and what evidence is delivered at the end. It should also state how rollback is handled if a node fails to rejoin. DeployOpen does not publish a price list, and a quote follows from the agreed scope, so the most useful input is an accurate node inventory and a clear picture of the compliance evidence you need.
Does changing the heap size affect the circuit breakers?
Yes. The parent circuit breaker defaults to 95 percent of JVM heap when real memory tracking is enabled, and 70 percent when it is not. Because these limits are a share of heap, raising or lowering heap changes the amount of memory the breakers allow before rejecting requests. Engineers should check the breaker settings after any heap change and confirm that rejected requests do not rise under normal load. Keep the heap at about half of system RAM so the operating system still has memory for the file system cache, and review the circuit breaker settings before changing either value.
Limits to confirm in your environment
The heap, kernel and shared memory settings on this page are starting points, not guarantees. Each card names a value that depends on your OpenSearch version, enabled features, container platform or hypervisor, and workload, and each should be confirmed against the release documentation and your own load tests before a production cutover.
Performance Analyzer memory need
Performance Analyzer reads from /dev/shm, and the documented need can reach 1 GB depending on what you enable. Confirm the exact requirement for your OpenSearch version and the monitoring features you turn on, then size shared memory to that figure rather than to a default. Verify the number under a load test that resembles your peak indexing and query pattern.
Performance Analyzer docsContainer shm honoring
Docker defaults /dev/shm to 64 MB, which can be below what Performance Analyzer needs. Confirm whether your container runtime, Kubernetes distribution and pod security policies let you raise shared memory for OpenSearch pods, and whether a medium: Memory volume or a runtime flag is required. Check the effective size inside a running container, not only in the manifest.
Host vs. hypervisor kernel settings
The recommended vm.max_map_count of at least 262144 must be applied at the level that actually runs the containers or processes. Confirm whether your hypervisor, cloud image, node template or Kubernetes node bootstrap overrides it, and whether a restart or reboot resets the value. Make the setting persistent through your configuration management, then verify it on every node.
Heap behavior in your version
The guidance is to set Java heap to about half of system RAM, but the way heap is sized, reported and limited can change between releases. Confirm the heap defaults, the JVM options file location and any container-aware memory handling for the exact version you deploy. Check that the heap plus off-heap memory, file caches and shm still fit within the node's memory limit.
Circuit breaker thresholds for your workload
The parent circuit breaker trips at 95 percent of JVM heap when real memory tracking is on, and at 70 percent when it is off. Confirm which mode your version and configuration use, then test whether large aggregations, bulk requests or wide queries trip it under realistic load. Change breaker limits only after you understand which request class is tripping and why.
Circuit breaker settingsHow DeployOpen works on this
DeployOpen plans, builds and documents OpenSearch host settings inside your own infrastructure, including JVM heap, vm.max_map_count, shared memory for Performance Analyzer and circuit breaker behavior. The work is fixed-scope, so the settings, the nodes they apply to and the evidence of checks are agreed in writing before any change is made to a node.
How we scope
- We inventory node sizes, operating systems, container runtimes and how each node is deployed to decide which settings apply where.
- The written scope names the heap sizing rule per node role, the host kernel and memory settings, and the systems that will be checked.
- We confirm with you whether Performance Analyzer is enabled, since that decides whether shared memory sizing is in scope.
How we build
- We set heap to about half of system RAM on each node and record the chosen values in the deployment configuration.
- We apply vm.max_map_count of at least 262144 and make it persist across reboots through your configuration management.
- We size /dev/shm for containers where Performance Analyzer runs, and check parent circuit breaker limits against the heap you set.
How we hand over
- You receive a settings register listing each node, heap value, kernel parameter, shared memory size and the file where it is set.
- We document the verification commands your team can run after patching, restarts or node replacements.
- Handover includes a walkthrough of how to change heap or host settings safely during future scaling or upgrades.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer, covering settings drift after new nodes or releases.
- Retainers can re-check host settings after each OpenSearch minor version update, which your team should confirm against the release notes.
- Your team keeps ownership of the cluster, and we advise on changes rather than operating it without agreement.

