Skip to content

Commit 150c25e

Browse files
committed
Imported opster information
1 parent d2ac44d commit 150c25e

File tree

1 file changed

+40
-12
lines changed

1 file changed

+40
-12
lines changed

docs/reference/troubleshooting/common-issues/high-cpu-usage.asciidoc

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ If a thread pool is depleted, {es} will <<rejected-requests,reject requests>>
99
related to the thread pool. For example, if the `search` thread pool is
1010
depleted, {es} will reject search requests until more threads are available.
1111

12-
You might experience high CPU usage if a <<data-tiers,data tier>>, and therefore the nodes assigned to that tier, is experiencing more traffic than other tiers. This imbalance in resource utilization is also known as <<hotspotting,hot spotting>>.
13-
1412
****
1513
If you're using Elastic Cloud Hosted, then you can use AutoOps to monitor your cluster. AutoOps significantly simplifies cluster management with performance recommendations, resource utilization visibility, real-time issue detection and resolution paths. For more information, refer to https://www.elastic.co/guide/en/cloud/current/ec-autoops.html[Monitor with AutoOps].
1614
****
@@ -60,21 +58,51 @@ backlog of tasks>>.
6058
The following tips outline the most common causes of high CPU usage and their
6159
solutions.
6260

63-
**Scale your cluster**
61+
**Check JVM garbage collection**
62+
63+
High CPU usage is often caused by excessive JVM garbage collection (GC) activity. This excessive GC typically arises from configuration problems or inefficient queries causing increased heap memory usage.
64+
65+
For optimal JVM performance, garbage collection should meet these criteria:
66+
67+
* Young GC completes quickly (ideally within 50 ms).
68+
* Young GC does not occur too frequently (approximately once every 10 seconds).
69+
* Old GC completes quickly (ideally within 1 second).
70+
* Old GC does not occur too frequently (once every 10 minutes or less frequently).
71+
72+
Excessive JVM garbage collection usually indicates high heap memory usage. Common reasons for increased heap memory usage include:
73+
74+
* Oversharding of indices
75+
* Very large aggregation queries
76+
* Excessively large bulk indexing requests
77+
* Inefficient or incorrect mapping definitions
78+
* Improper heap size configuration
79+
* Misconfiguration of JVM new generation ratio (-XX:NewRatio)
80+
81+
**Hotspotting**
82+
83+
You might experience high CPU usage on specific data nodes or an entire <<data-tiers,data tier>> if traffic isn’t evenly distributed—a scenario known as <<hotspotting,hot spotting>>. This can happen when applications aren’t properly balancing requests across nodes or when “hot” write indices concentrate indexing activity on just one or a few shards.
84+
85+
For details on diagnosing and resolving hotspotting, see <<hotspotting,hot spotting>>.
86+
87+
**Oversharding**
88+
89+
If your Elasticsearch cluster contains a large number of shards, you might be facing an oversharding issue.
6490

65-
Heavy indexing and search loads can deplete smaller thread pools. To better
66-
handle heavy workloads, add more nodes to your cluster or upgrade your existing
67-
nodes to increase capacity.
91+
Oversharding occurs when there are too many shards, causing each shard to be smaller than optimal. While Elasticsearch doesn’t have a strict minimum shard size, an excessive number of small shards can negatively impact performance. Each shard consumes cluster resources since Elasticsearch must maintain metadata and manage shard states across all nodes.
6892

69-
**Spread out bulk requests**
93+
If you have too many small shards, you can address this by:
94+
* Removing empty or unused indices.
95+
* Deleting or closing indices containing outdated or unnecessary data.
96+
* Reindexing smaller shards into fewer, larger shards to optimize cluster performance.
7097

71-
While more efficient than individual requests, large <<docs-bulk,bulk indexing>>
72-
or <<search-multi-search,multi-search>> requests still require CPU resources. If
73-
possible, submit smaller requests and allow more time between them.
98+
See <<size-your-shards,Size your shards>> for more information.
99+
**Additional recommendations**
74100

75-
**Cancel long-running searches**
101+
To further reduce CPU load or mitigate temporary spikes in resource usage, consider these steps:
76102

77-
Long-running searches can block threads in the `search` thread pool. To check
103+
* Scale your cluster: Heavy indexing and search loads can deplete smaller thread pools.Add nodes or upgrade existing ones to handle increased indexing and search loads more effectively.
104+
* Spread out bulk requests: Submit smaller <<docs-bulk,bulk indexing>> or multi-search requests and space them out to avoid overwhelming thread pools.
105+
* Cancel long-running searches: Regularly use the task management API to identify and cancel searches that consume excessive CPU time. To check
78106
for these searches, use the <<tasks,task management API>>.
79107

80108
[source,console]

0 commit comments

Comments
 (0)