简体   繁体   English

增加node-RED的memory

[英]Increase the memory of node-RED

I created a dashboard in node-RED which you can do messurements with.我在 node-RED 中创建了一个仪表板,您可以使用它来进行操作。 All the messurements are saved in a MySQL database.所有的消息都保存在 MySQL 数据库中。 The user can display the database in a table or download it as a CSV.用户可以在表格中显示数据库或将其下载为 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.目前它充满了 900.000 个消息,总大小约为 50MB。 Whenever I try to load the table or the CSV inside the dashboard, it freezes and displays Out of Memory .每当我尝试在仪表板内加载表格或 CSV 时,它都会冻结并显示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).所以我检查了使用了多少 memory 并注意到 node-red 从未使用超过总 memory 的 10%(我使用的是 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.我做了一些研究,大多数人都在谈论node --max-old-space-size=3072 /usr/local/bin/node-red这对我不起作用。

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贾斯汀

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).在一张图上尝试和 plot 90 万个数据点是没有意义的(您没有足够宽的显示器来为每个点显示 1 个像素)。

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.正如@CherryDT 在评论中所说,这将是浏览器在 plot 上苦苦挣扎,而不是处理数据库响应的 Node-RED 进程。

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.正确的解决方案是更改查询以进行一些数据缩减,或者在将结果发送到 Dashboard UI 图表节点之前对其进行处理以删除大部分数据。

It's up to you to decide what is a sensible way to reduce the data (eg average of time for a group of points).由您决定什么是减少数据的明智方法(例如一组点的平均时间)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM