Node red becoming increasingly un-responsive until restart

Hi All

Over the last few weeks I have noticed node red gets more and more unresponsive until eventually it just seems to stop working completely. When I restart it's fine again initially but gradually gets slower.

Are there any recommended ways of debugging this sort of thing?

I use hue-magic to listen to button presses on hue dimmer switches and then control the lights. I have a few other nodes installed as well so I suppose I just need to start removing them...

Are you using charts? If so then work out how many points you are plotting on each line on the chart. So for example is a chart is configured with a range of 24 hours and you are adding points every 5 minutes that would be 288 points. However if you were adding a point every 5 seconds then that would be 17280 points, and if you had 4 charts each with 4 lines that would be a total of 276480 points to be shuffled down every 5 seconds. This can have a dramtic effect on the system, particularly the browser. Note that there is little point having more that one data point for each pixel on screen, so for example if your graph were 200 pixels across with a range of 24 hours then the max sensible sample rate is about every 5 or 10 minutes.

If you aren't using charts then tell us a bit more about the system. What hardware/os, how did you install node-red. Are you running the browser on the node-red server machine or on a separate device? If you run a system monitor (such as top on a pi) does it show anything notable?

No I am not using charts and sorry, I should have been more specific. This is not the node-red ui becoming slow, this is the nodes becoming slow. i.e. I press the button on my hue dimmer switch and takes 10 -20 seconds for the node-red action to be taken.

Node-red is running on a raspberry pi 3. I installed it using the recommended install scripts. I've looked at the logs (node-red-logs) and nothing of note is in there. When configuring node-red I use my windows desktop machine.

Next time it runs slow I'll try top and take a look. Thanks.

Try this too, stick a `debug' node on the output of which ever node is receiving the result of you pressing te dimmer. Then press the dimmer and watch how long it takes for that msg to arrive at NR.

You might also want to keep track of the memory, CPU and SWAP utilisation of the Pi as that is more likely to tell you what is happening.

However, it sounds like something is leaking memory. Possibly this is triggering some SWAP activity which is really slow on a Pi.

Run 'top' in a ssh session while NR is running. The node engine will consume resources and multithread as it takes over the system, you should be able to turn each flow on and off in NR, watch the impact via top. I do this all the time on PiZero devices, that have limited resources, and I can then decide how to handle which flows run when and how, so that I don't flood the PiZero into the ground, or so to speak.