# High CPU usages in Elastic Node

**URL:** https://discuss.elastic.co/t/high-cpu-usages-in-elastic-node/277996
**Category:** Kibana
**Created:** [July 6, 2021, 9:36pm UTC](https://discuss.elastic.co/t/high-cpu-usages-in-elastic-node/277996 "2021-07-06T21:36:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![TonyLuc](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@TonyLuc](https://discuss.elastic.co/u/TonyLuc)
#### Post date: [July 6, 2021, 9:36pm UTC](https://discuss.elastic.co/t/high-cpu-usages-in-elastic-node/277996/1 "2021-07-06T21:36:03Z")

</div>

High CPU usages in Elastic Node

In a development setting, I have both ElasticSearch, Kibana and MetricBeat running on the same server.

The CPU resources are so high that I couldn’t remote onto the server. It is only when I shut down the Kibana Services that I can regain control of the server.

This is first observed after upgrading from 7.10.0 to 7.13.2.

Setup is configured to “Collecting Elasticsearch monitoring data with Metricbeat”. I can use the Stack Monitoring UI to see the health of all the nodes in the cluster, including Kibana.

There are no errors recorded in all the logs (Elasticsearch, Kibana, and Metricbeat). Apart from those in Kibana that failed as there are insufficient resources available that mostly resulted in “bad gateway” errors.

Workaround: The CPU usage stabilized when kibana monitorings are switch off. i.e. kibana-xpack module disabled and monitoring.enabled: false in Kibana.yml.

Seeking advices in troubleshooting the issues. Would really appreciate any helps! Thanks!

Here the breakdown of the Development Environment (on-premise)

Architecture: Cluster, 4 data nodes, 3 master nodes

Server having issues:

Data Node with Kibana (this is the initial server used to proof out Elastic before setting it up as part of a cluster)

Server: Windows Server 2016 (non-physical) 16 Gigabytes RAM, 80 Gigabytes (One of my Oliver Twist “Please Sir I want some more” moment)

Elastic Version: 7.13.2 using bundled OpenJdk 16.0, set to 8 GB in vm.options

\*\*\*\*\* Check List \*\*\*\*\*\*

\*\*\* ElasticSearch \*\*\*

- xpack.monitoring.collection.enabled = true

- xpack.monitoring.elasticsearch.collection.enabled to false

\*\*\* MetricBeat \*\*\*

On all Elasticsearch nodes

- metricbeat modules enable elasticsearch-xpack

- Configure elasticsearch-xpack.yml

- Use builtin user: remote\_monitoring user

- Configuration correct: Able to see status of individual nodes in Stack Monitoring

- metricbeat modules disable system

- metricbeat modules enable kibana-xpack

- Use builtin user: remote\_monitoring user

- Configuration correct: Able to see status of kibana in Stack Monitoring

\*\*\* Kibana \*\*\*

monitoring.enabled: true

monitoring.kibana.collection.enabled: false

---

<div class="post-metadata">

### Author: ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)
#### Post date: [July 7, 2021, 11:21pm UTC](https://discuss.elastic.co/t/high-cpu-usages-in-elastic-node/277996/2 "2021-07-07T23:21:14Z")

</div>

Hello,

Does this issue looks like it applies to you?

> <https://github.com/elastic/kibana/pull/104535>
>
> Upgrading to Node 12+ removed the 1.4gb heap allocation limit,
> and set it to sc…ale with total available memory.
> 
> \> \[1\] Properly configure default heap limits
> This update will configure the JavaScript heap size based on available
> memory instead of using defaults that were set by V8 for use with
> browsers. In previous releases, unless configured, V8 defaulted to
> limiting the max heap size to 700 MB or 1400MB on 32 and 64-bit
> platforms respectively. Configuring the heap size based on available
> memory ensures that Node.js does not try to use more memory than is
> available and terminating when its memory is exhausted.
> 
> \[1\] nodejs.medium.com/introducing-node-js-12-76c41a1b3f3f
> 
> This updates our documentation to reflect this change.
> 
> Closes #104451

cc @jbudz

Thanks  
Bhavya

---

<div class="post-metadata">

### Author: ![TonyLuc](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@TonyLuc](https://discuss.elastic.co/u/TonyLuc)
#### Post date: [July 8, 2021, 7:53pm UTC](https://discuss.elastic.co/t/high-cpu-usages-in-elastic-node/277996/3 "2021-07-08T19:53:48Z")

</div>

Thanks, Bhavya

The request [_Update default memory limit_](https://github.com/elastic/kibana/pull/104535) look interesting.

> The basis of this request is to ensure that Node.js does not use more memory than available and terminate when the its memory is exhausted.

It is a very likely scenario for me, where the CPU resources run amok. Currently, I stop the Kibana Services to free up the resources.

This is self-inflicted, with limited resources, Kibana and Elasticsearch Services are running on the same machine. This problem wasn’t observed in Production as the services are running on different machines.

To workaround this, I am reducing the default memory limit in Kibana.  
Setting the **--max-old-space-size** in the **node.options** config file found inside the **kibana/config** folder. Reference: [_Use Kibana in a production environment_](https://www.elastic.co/guide/en/kibana/7.13/production.html#memory)

I am going to keep tabs on machine for a few days to make sure that it resolves the problem.

Thanks for the helps!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 5, 2021, 7:54pm UTC](https://discuss.elastic.co/t/high-cpu-usages-in-elastic-node/277996/4 "2021-08-05T19:54:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
