Home > Software design >  Increase the memory of node-RED
Increase the memory of node-RED

Time:09-26

I created a dashboard in node-RED which you can do messurements with. All the messurements are saved in a MySQL database. The user can display the database in a table or download it as a CSV.

Everything just works fine until the database is getting bigger. Currently it's filled with 900.000 messurements and has a total size of around 50MB. Whenever I try to load the table or the CSV inside the dashboard, it freezes and displays Out of Memory.

So I checked how much memory is being used and noticed that node-red is never ever using more than 10% of the total memory (I'm using a Raspberry Pi 4GB).

I did some research and most people talking about node --max-old-space-size=3072 /usr/local/bin/node-red which isn't working for me.

So my question is, is there anything else I can set up? One of the developers told me about a service file but wasn't very specific. Maybe somebody else can tell me more about that.

Thanks in advance

Justin

CodePudding user response:

It doesn't make sense to try and plot 900 thousand data points on one graph (you don't have a display wide enough to show 1 pixel for every point).

As @CherryDT said in the comments, this is going to be the browser that is struggling to plot that many points, not the Node-RED process handling the database response.

The correct solution is to either change the query to do some data reduction, or to process the results before sending it to the Dashboard UI chart node to remove most of the data.

It's up to you to decide what is a sensible way to reduce the data (e.g. average of time for a group of points).

  • Related