Good day peeps!!
First off... I am at kindergarten level... Small words only!!
I have a fairly large flow set that runs my home auto system... There is a fair amount of to and fro on mqtt from Inverter/Sonoff/Tasmota switches that I control and monitor with the pi...(EmonCMS)
My cpu usage on the pi (Pi4/4gb/16gb sd) hovers around the 15 to 25% mark as displayed on a management dash, when live imaging the SD card for backup, it can go as high as 80 to 90%, but then drops after the image process back to the "normal" cpu occupancy.
At a random period though, the cpu will suddenly jump to 100% and all things come to a grinding halt - This can be anything from 24hrs to 120hrs operation, sometimes longer, making it difficult, to say the least, to track....(Regardless of time of day or solar activity)
Optimising node traffic as far as possible(with my limited knowledge) has not been successful..
As to when it started, it's a while back - Bear in mind this is a 3yr old install, plus a bit... The bulk of the problems seem to have come about when migrating from a PI3 to a Pi4, that's about all I can surmise.... Unfortunately, with the Pi4, additional modules were written in soon after as there was extra horsepower to use... possibly compounding a dormant problem...
Furthermore, this being an "old" install of node.js and Node-Red(and everything else), settings and original parameters have been "carried forward" - Possibly being the actual "root" of the problem...
From my dinosaur based experience and knowledge, the problem seems to be of "open files" nature... Almost as if there is a setting that has been missed to "time out and close" used files... These accumulate over a number of hours, eventually causing mayhem...
Possibly too(in fact more than likely), there mights be a bit of "ignorant bad programming practise" involved as well... I am using this platform to learn as I go...
Any advice on where and what to check would be of great assistance!
Regds
Ed