Here is a similar thread, that hasn't really been resolved:
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.
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 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:
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: