Is it good practice to restart Pi every few days?

I’ve had this same issue when using NodeRED, are you using any 3rd party nodes?

That would be a bug, if a purge is overdue it is supposed to happen shortly after startup.

It is anyway preferable to purge every day, smaller purges should perform better.

I have one for Spotify (now removed) and node-red-contrib-castv2.
The rest are all default

when running htop is it normal to have several instances of same application?

Yep that’s fine, a process such as nodered will spawn many sub-processes, I get the same thing:

I would try removing node-red-contrib-castv2 and restart NodeRED and see how much memory it uses. Node memory usage can be a pain to track, just google/ddg search for ‘node memory usage’ and you’ll find things like this:

thanks … for now I started the process to move as much automations as possible from Node-Red to automations.yaml and monitor. I have 140 nodes running which I think is a bit too much for the Pi3B+

Here’s an interesting article on Python Garbage Collector. Worth reading to give you an insight to those unexplained memory leaks consuming available memory https://www.google.ie/amp/s/stackify.com/python-garbage-collection/amp/

1 Like

thanks … is this something I can implement to help in my problem?

was going through Node-Red logs and noted the following (refer to line in bold)

23 Nov 15:03:41 - [info] Flows file : /config/node-red/flows.json
23 Nov 15:03:41 - [info] Server now running at http://127.0.0.1:46836/
[15:03:41] INFO: Starting NGinx…
23 Nov 15:03:41 - [info] Starting flows
> nginx: [alert] detected a LuaJIT version which is not OpenResty’s; many optimizations will be disabled and performance will be compromised (see GitHub - openresty/luajit2: OpenResty's Branch of LuaJIT 2 for OpenResty’s LuaJIT or, even better, consider using the OpenResty releases from OpenResty - Download)
23 Nov 15:03:41 - [info] Started flows
23 Nov 15:03:46 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant

Could this be the issue or this is normal?

I’m not sure, I’m running the official release of NodeRED v1.03 from here:

And I’m not getting that ‘LuaJIT’ error.

What version of NodeRED are you running? I know some older versions had some memory issues.

im using v5.0.3

Hmm, by the sounds of it something has caused your NodeRED install to go bad if you are getting errors, you should be getting no errors.

I would remove it and install the latest v1.03 which was released 2 days ago from the link I posted, here’s what my log shows and I get no errors:

Nov 23 18:45:15 pipi systemd[1]: Started Node-RED graphical event wiring tool.
Nov 23 18:45:16 pipi Node-RED[16416]: 23 Nov 18:45:16 - [info]
Nov 23 18:45:16 pipi Node-RED[16416]: Welcome to Node-RED
Nov 23 18:45:16 pipi Node-RED[16416]: ===================
Nov 23 18:45:16 pipi Node-RED[16416]: 23 Nov 18:45:16 - [info] Node-RED version: v1.0.3
Nov 23 18:45:16 pipi Node-RED[16416]: 23 Nov 18:45:16 - [info] Node.js  version: v10.17.0
Nov 23 18:45:16 pipi Node-RED[16416]: 23 Nov 18:45:16 - [info] Linux 4.19.75-v7l+ arm LE
Nov 23 18:45:17 pipi Node-RED[16416]: 23 Nov 18:45:17 - [info] Loading palette nodes
Nov 23 18:45:19 pipi Node-RED[16416]: 23 Nov 18:45:19 - [info] Settings file  : /home/pi/.node-red
Nov 23 18:45:19 pipi Node-RED[16416]: 23 Nov 18:45:19 - [info] Context store  : 'default' [module=
Nov 23 18:45:19 pipi Node-RED[16416]: 23 Nov 18:45:19 - [info] User directory : /home/pi/.node-red
Nov 23 18:45:19 pipi Node-RED[16416]: 23 Nov 18:45:19 - [info] Server now running at http://127.0.
Nov 23 18:45:19 pipi Node-RED[16416]: 23 Nov 18:45:19 - [info] Active project : pipi_node_red
Nov 23 18:45:19 pipi Node-RED[16416]: 23 Nov 18:45:19 - [info] Flows file     : /home/pi/.node-red
Nov 23 18:45:19 pipi Node-RED[16416]: 23 Nov 18:45:19 - [info] Starting flows
Nov 23 18:45:19 pipi Node-RED[16416]: 23 Nov 18:45:19 - [info] Started flows

Be sure to back to your flows first. :slight_smile:

I installed mine from the add-ons … will take make a difference?

today problem occurred again, and Pi was restarted just yesterday due to a power failure.

As usual I was not able to connect via https and CLI was very very slow when using the domain URL.
Once I arrived home and connected to my wifi, I tried to connect to CLI using the private IP address and Pi came back to live!!! Even using the domain URL started working. Any ideas of what is the issue?

Yes I think the addon includes lots of extras, but I don’t use the addon myself, so don’t know a whole lot about it.

Any ideas of what is the issue?

I’m afraid not, just keep checking top or htop if you can to check what process if gobbling up your memory, in fact you can even record memory usage to the HA database.

EDIT: Something like this: 16

1 Like

Thanks… I done that… But now I found something new :slight_smile: check out my last post

Did you manage to see how much RAM is being used when it was very slow? Or were you unable to even load top or htop?

after several attempts managed, but I was not able to sort by memory

Your system’s slow because you’re now using SWAP memory, this will kill your SDCard faster than anything.

node-red appears to be using 37.6% of your total system RAM.

I am using an SSD (120GB) … how can I improve the SWAP problem?