It feels like its something not closing down/cleaning up properly, so it adds another instance on each deploy. Do you also have any extra (3rd party) nodes in the flow? Especially ones that may make network connections ?
There's nothing outside of the basic nodes, no I/O except for MQTT nodes.
All you might see is an ancient version of Node-Red.
$ node-red
28 Jul 22:39:31 - [info]
Welcome to Node-RED
===================
28 Jul 22:39:31 - [info] Node-RED version: v0.17.5
28 Jul 22:39:31 - [info] Node.js version: v6.17.1
28 Jul 22:39:31 - [info] Linux 4.9.35-v7+ arm LE
28 Jul 22:39:34 - [info] Loading palette nodes
28 Jul 22:39:58 - [info] Dashboard version 2.6.2 started at /ui 28 Jul 22:40:09 - [warn] ------------------------------------------------------
28 Jul 22:40:09 - [warn] [server] SyntaxError: Unexpected identifier
28 Jul 22:40:09 - [warn] [server-events] SyntaxError: Unexpected identifier
28 Jul 22:40:09 - [warn] [server-state-changed] SyntaxError: Unexpected identifier
28 Jul 22:40:09 - [warn] [trigger-state] SyntaxError: Unexpected identifier
28 Jul 22:40:09 - [warn] [poll-state] SyntaxError: Unexpected identifier
28 Jul 22:40:09 - [warn] [api-call-service] SyntaxError: Unexpected identifier (line:2)
28 Jul 22:40:09 - [warn] [api-current-state] SyntaxError: Unexpected identifier (line:1)
28 Jul 22:40:09 - [warn] [api-get-history] SyntaxError: Unexpected identifier (line:2)
28 Jul 22:40:09 - [warn] [api-render-template] SyntaxError: Unexpected identifier (line:2)
28 Jul 22:40:09 - [warn] ------------------------------------------------------
28 Jul 22:40:09 - [info] Settings file : /home/pi/.node-red/settings.js
28 Jul 22:40:09 - [info] User directory : /home/pi/.node-red
28 Jul 22:40:09 - [info] Flows file : /home/pi/.node-red/flows_Marvin.json
28 Jul 22:40:11 - [warn] Communication server error: Error: listen EADDRINUSE 0.0.0.0:1880
28 Jul 22:40:11 - [error] Unable to listen on http://127.0.0.1:1880/
28 Jul 22:40:11 - [error] Error: port in use
Well, that report doesn't look good.
The server state changed to me is of concern. If it is changing the state of the server that is work. Work is time. Time is being lost in/on this flow.
Also the api-call-service SyntaxError.
Can you identify who these nodes are?
Also an ancient and unsupported version of nodejs. Is there a reason you don't use the upgrade script from the node red docs to bring it all up to date?
well most of those error messages are not from core nodes - so indeed there are other nodes in play - and as @Trying_to_learn suggests they may well be trying to make connections in the background and clogging everything up... Just because the node isn't in the flow doesn't mean that it isn't loaded into the system. Nodes should be well behaved about this - but obviously some aren't. If you aren't using them - completely uninstall them.
Because every time I upgrade Node-Red, stuff breaks. This particular project will be moot at the end of this week and I'll risk it then. The risk should be lower, though, because I have been moving my flows to an Intel Nuc which does have the latest version of Node-Red and nodejs.
This is also one of the reasons I suggested that this discussion should pause. I was mostly looking to see if someone else was seeing the same issue.
well most of those error messages are not from core nodes - so indeed there are other nodes in play - and as @Trying_to_learn suggests they may well be trying to make connections in the background and clogging everything up... Just because the node isn't in the flow doesn't mean that it isn't loaded into the system. Nodes should be well behaved about this - but obviously some aren't. If you aren't using them - completely uninstall them.
I have another Node-Red server on an Intel Nuc, but only one broker, on the Pi3 that is also running this flow where I am seeing the problem.
I ran top and sudo journalctl -n 30 -u nodered -o cat on two terminal windows and made an interesting observation.
When the %CPU for Node-Red went up, I was seeing a lot of this error on journalctl:
Failed to GET info from http://172.17.0.1:44221/upnp/amazon-ha-bridge/setup.xml
But the %CPU for mosquitto didn't go up.
SO- is it possible that I don't have a Node-Red problem at all, but a misbehaving Alexa device? Why this would cause the Node-Red %CPU to go over 100% is a mystery to be solved later.
do you have an alexa node in the palette - but (supposedly) not used ?
though if something else is chewing/leaking memory then at some point it will force node-red to have to page memory to "disk" which will then get slow...
SO- is it possible that I don't have a Node-Red problem at all, but a misbehaving Alexa device? Why this would cause the Node-Red %CPU to go over 100% is a mystery to be solved later.
Yup! If not Alexa then something similar. As Dave has already said, this is a problem with something not closing down correctly. It very likely doesn't therefore release a network connection which causes you problems as it tries to reconnect. Getting slowly worse and worse.
Dave also mentions paging and this can cause high CPU on a Pi thanks to the way the SD-Card interface is handled, it wouldn't generally cause high CPU on something with a proper disk interface.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.