Type to search.

Unbalanced GC ratio

ECH

Elastic Cloud Hosted lets you manage and configure one or more deployments of the versioned Elastic Stack, hosted on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

ECK

Elastic Cloud on Kubernetes extends Kubernetes orchestration capabilities to allow you to deploy and manage components of the Elastic Stack.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

ECE

Elastic Cloud Enterprise is a self-managed orchestration platform for deploying and managing the Elastic Stack at scale.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Self-managed

Self-managed deployments are Elastic Stack deployments managed without the assistance of an orchestrator.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Garbage collection time is unbalanced between young and old heap generations on the affected node. The node might pause more often while old-generation collections run, which hurts search and indexing responsiveness.

Note

For a complete list of insights, refer to AutoOps insights.

Field Value
Component Elasticsearch
Severity Medium
Scope Node
Domains performance, cpu, stability

You can customize these settings to adjust when AutoOps detects this event and presents the insight. Refer to AutoOps event settings for details.

The default customization settings are:

Setting Type Default
Delta between old and young GC in percentage Percentage 50

The following is an example of what you might see when this insight is triggered. Real insights use live data and links from your deployment or cluster.

Old and young GC time shares are unbalanced on es-data-01 and es-data-02. old GC is loading more than young GC.

  • Indices with high search activity: logs-prod-000045

  • Indices with high indexing activity: logs-prod-000045

Note

AutoOps shows different recommendations depending on how their conditions match your deployment or cluster.

Balance old and young GC

Condition: Shown when the gc-old / gc-new ratio diverges by more than 50%.

Set -XX:NewRatio=2 in your JVM options file to tune the ratio between old and young GC, then perform a rolling restart of affected nodes.

Increase parallel GC threads

Condition: Shown when gC load is unbalanced across nodes.

Set -XX:ParallelGCThreads to the number of available processors on the data node, then restart the node.

Enable and review search slow logs

Condition: Shown when gC load is unbalanced across nodes.

Enable search slow logs with the action below, then review the slow log to find expensive queries. See Slow logs for configuration details.

JSON
PUT logs-prod-000045/_settings
{
  "index.search.slowlog.threshold.query.warn": "10s",
  "index.search.slowlog.threshold.query.info": "5s",
  "index.search.slowlog.threshold.query.debug": "2s",
  "index.search.slowlog.threshold.query.trace": "500ms",
  "index.search.slowlog.threshold.fetch.warn": "1s",
  "index.search.slowlog.threshold.fetch.info": "800ms",
  "index.search.slowlog.threshold.fetch.debug": "500ms",
  "index.search.slowlog.threshold.fetch.trace": "200ms"
}
Note

Requires the manage index privilege. Requires Elasticsearch 8.0.0 or later. This action changes cluster or index configuration.

The JVM frees heap with young-generation and old-generation collectors. Young collections normally run more often and finish quickly. Old collections reclaim longer-lived objects and can pause the node longer when they run.

When the time share between generations diverges sharply, the heavier generation dominates pause time. The node can stop responding more often while old GC completes. Heavy search or indexing on the same node often contributes to the imbalance.

High JVM memory pressure