# CPU spikes - fresh install in docker

**URL:** https://discourse.nodered.org/t/cpu-spikes-fresh-install-in-docker/60514
**Category:** General
**Tags:** docker
**Created:** [29 March 2022 20:44 UTC](https://discourse.nodered.org/t/cpu-spikes-fresh-install-in-docker/60514 "2022-03-29T20:44:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![singletonerik](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/singletonerik/32/58993_2.png) [@singletonerik](https://discourse.nodered.org/u/singletonerik)
#### Post date: [29 March 2022 20:44 UTC](https://discourse.nodered.org/t/cpu-spikes-fresh-install-in-docker/60514/1 "2022-03-29T20:44:23Z")

</div>

Here is a similar thread, that hasn't really been resolved:

> [@Node-RED on docker causes regular CPU spikes](https://discourse.nodered.org/t/node-red-on-docker-causes-regular-cpu-spikes/54112):
>
> Docker is running on a relatively low-end Linux system with dual-core processor of type Intel Celeron N3350 and 4GB of memory. About 15 microservice containers run together, communicating with each other and to the outside world. When I add a fresh nodered/node-red:latest container with no custom options or properties, it causes almost-regular CPU spikes up to 95% of the core it uses, +/- every 30 minutes. I repeat that this container is fresh/empty: there are no plugin nodes installed, and the…

I am running a totally blank instance of Node-RED on an e2 shared core GCE VM (their free tier offer for compute).

I am seeing CPU spikes every 30s, and I was wondering if there is some kind of polling happening that I could turn off, or generally if there is a way to reduce or fully remove this from happening. Here is a visualization from lazydocker that I believe they are pulling from docker stats.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/1/11956e53f801c9e97a140218c1686b39de9e7cee.png)

Here is an image from GCP VM monitoring showing the difference with nodered off vs on:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c7e9d970fd8f887f1adacfbeba40dafd3a2e5106.png)

Avg CPU utilization goes from 1.8% (running Traefik and Portainer) to 8.2% when nodered is running.

Any thoughts on why this would be? Again, there are no nodes running at all, this is a fresh install.

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [29 March 2022 23:16 UTC](https://discourse.nodered.org/t/cpu-spikes-fresh-install-in-docker/60514/2 "2022-03-29T23:16:56Z")

</div>

Hi @singletonerik,

I have had a look at a Node-RED container running on my Windows portable, but I don't see such spikes unfortunately so cannot reproduce it. You might try my [node-red-contrib-v8-cpu-profiler](https://github.com/bartbutenaers/node-red-contrib-v8-cpu-profiler/blob/main/README.md) node to analyze the CPU usage. Not sure it will reveal the root cause...

The github repo contains also a wiki page with a step-by-step tutorial.

I have runned it now for 5 minutes:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5b83cb0894021c760f99766038cf7a78a8c996b1.png)

So after that time, a .profile file is generated.  
When I analyze that profile file with Chrome Developer tools (as described in the wiki), I see only very small peaks in my case. So the resulting flame chart is almost invisible (in the ellipse). But at least I can see from which Node-RED statements these peaks are triggered:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/d/9da9ae4c2adff07b0e12971bbcb7d97f4da81939.png)

But perhaps it can help you during troubleshoothing...  
Bart

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [28 May 2022 23:17 UTC](https://discourse.nodered.org/t/cpu-spikes-fresh-install-in-docker/60514/3 "2022-05-28T23:17:03Z")

</div>

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