Node-RED on docker causes regular CPU spikes – General

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 there are no active flows at all. Given the fact that the system I’m using is not very high-end, it sometimes crashes if the other processes are also under some CPU stress.

I am sure that this is a Node-RED issue, because I had already set up monitoring for CPU usage per container on the system. Below is a graph of Node-RED’s CPU usage (I have filtered out the other containers for clarity).

Several other Node.js containers run on this system, without similar effects. I briefly set up memory monitoring, but it remains at +/- 2% (80MB) at all times, so I think that is unlikely to have an influence.

I have already looked at other threads on this forum, I have tried adding the NODE_OPTIONS environment variable to the container with –max-old-space-size=256, to no avail. I have tried running strace, but I can’t install it on the alpine-linux container it is running in. I have also tried installing Node-RED on another system that is similar but more high-powered, and the pattern persists (minus the crashes).

When I run the container on my local Windows system, it shows similar spikes but they happen more often and are way less pronounced (I have a more high-end quad-core system):

Read more here: Source link