Hello! In one of my projects, I use Node-RED for automation. I'm not a programmer at all, but Node-RED allows me to automate certain things and deepen my understanding. The gist is: I have agents on Selenium, and these agents interact with Node-RED using GET requests to receive tasks. They send results via POST requests, and specific logic is processed in Node-RED, linked to functions and MySQL. I've tried to minimize MySQL connections, and by using link-in/link-out, most of the requests are sent to MySQL, where a delay is set to limit the requests to no more than 4 per second. Everything I wanted from this system I’ve achieved, and it works perfectly. But there's one unpleasant issue: for reasons unknown to me, Node-RED restarts approximately every 5-10 minutes. The system parameters are as follows:
. Node-RED is running via pm2. The resources, as I understand, are more than sufficient:
. Sometimes, errors occurred related to writing into MySQL, but that was a problem with MySQL because the field type was set to varchar. I changed it to text, and the issue was resolved. The Node-RED logs are empty:
Approximately 2-3 http requests are received every second. The data that is received is small, no more than 5 KB. Each such query generates about 2-3 queries in mysql. I don't think it's much to force node-red to reboot. My palette
A google search using SMP PREEMPT_DYNAMIC (shown in the results of your u-name -a result) seem to indicate that NR can be preempted by another process running on the machine and that may be the cause of your problem.
Yes, it is a closed system that cannot be accessed from the Internet. Only some machines on the network have Internet access through a proxy. That's why we used root
journalctl -u node-red -e -f -n 10
and
dmesg | grep -i error
is empty
Yes, I understand, but this usually happens if there are not enough resources. Or various conflicts. In this case, it's a fresh centos installation and installing only node-red on it, nothing else has been installed. Minimal installation
Sorry but I'm not going to be able to help since I have no experience with the device or method you are using. Hopefully someone else will be able to chime in.
In my case, all logs are empty. But I found the culprit of the problem, in my case it was PM. His process was interrupted and this entailed restarting node-red. I redid the node-red launch into a service and now it works as it should.