I'm facing a pretty big issue here. I have Node Red installed on a few RPi and a Qnap NAS. They are all working in a network and the NAS instance is the main one. For quite some time I've noticed that when I connect to the NAS Node Red instance from my PC (using firefox) the CPU usage skyrockets to nearly 100%, the browser freeze and I can't do anything.
I was wondering if someone knows about this problem and how to solve it. I precise that Yes, my Node Red instance is rather heavy... Lots of nodes, lots of tasks, etc... But really, why is my PC doing the CPU work ? Isn't it only supposed to display the nodes while the RPi/NAS does the work ? What I'm asking is what exactly my CPU has to process to go to 100% usage ?
Node red is running on RPi and NAS, I access it from my WB on my PC.
The PC's CPU is going crazy, the process using all the CPU is called 'Web Content' and also uses 2.3Gb of RAM (out of 12...).
The browser is running on Ubuntu 18.04. I tried Firefox, Chromium and Opera. Same result...
I do have a lot of debug nodes but they are all switched off. Right now I can't even access Node red at all, my CPU is processing for a good 30min now and the page is frozen. I'm posting from another PC.
If I can access it one day you think that deleting the debug nodes can solve the problem ?
Sounds like debug nodes massively spamming output. Have you tried starting node-red in safe mode, to go around your flows and see if you can turn off some debug nodes or maybe look around a bit, then deploy and thus restart your flows?
Note that the docs are currently down for maintenance, but the command you need to start in safe mode is node-red --safe <other options> <flows.json>
But the debug nodes are all OFF ! Can they spam output even when they are off ?
Just for update : the 'Web Content' process is now holding 4Gb of RAM ! and still using most of the CPU ! If I didn't know it was Node Red I'd think I got a Virus !
Stop/kill node-red, restart it in safe mode, then go around your flows trying to find out what is going on. It could be a loop it's stuck in somewhere too. But without knowing anything else about your flows it's going to be a guessing exercise for us too. Restarting in safe mode, then checking your flows would be your best bet. When did this issue start?
Ok I'll restart now. I don't think there is any kind of loop. I don't actually use any in my flows... But the Debug outputs would make sense... The 'Web Content' process is probably trying really hard to load all of the outputs ?
The issue didn't start at a precise moment, it gradually increased until now when I can't do anything.
Not sure it's a loop (as that mostly affects server side).
Try disconnecting debug nodes if there is still an issue after turning them off. (Not 100% sure of the anatomy of the debug node - this may be superfluous)
Regarding the contents of debug output, are you posting any potentially large objects to debug nodes?
Ps a loop can be created unwittingly. For example subscribing to a wildcard like # and publishing to same MQTT broker in a subtopic can cause an MQTT loop)
Do you use many flows or do you use only one? long ago the same thing happened to me because I had concentrated the whole program in a single window with many dashboard nodes and many functions. If so, initialize Node Red in safe mode and try to fragment the flow into multiple windows and connect them together with the link nodes.