Increasingly slow and unresponsive Dashboard

Hello Guys,
I have the RPi3 with Raspian GNU/Linux 9 (stretch) and Node Red (V. 1.0.2). I use the Node Red to display some data riceved with mqtt communication in a period of 10sec. Initialy the dashboard with some gauge and one chart runs fine but after a certain period of time the dashboard works slow and then i get differnet messages: "Page unresponsive, connection lost, something went wrong while displaying this web page". And the cpu utilization is over 50%.
The node red console don't get errors.
I find:

You may need to elaborate on that a bit.
Does that mean for 10 seconds it is receiving the data, or do you mean every 10 seconds it receives data?

When you are looking at the dashboard, are you using the RPI to do this, or are you using another machine to view the page.
Personally I have always found problems running a browser on the same RPI as NR, and using it (the browser) to view the dashboard.

The chart. For how long period it is configured and how often the new data is feeded? Too much data for chart is usually the reason of unresponsive dashboard. There is many threads here you can find about this

3 Likes

Most definitely the chart. It's all about reducing the number of data points displayed and the update frequency. Both can heavily impact browser performance, especially on a RPi.

So either reduce the display period, as @hotNipi suggested.
Or aggregate the data in Node-RED first, before sending it to the dashboard. Do you really need live data? Maybe an interval of 1min or so would be sufficient, too.

Hello,
Thank you for your interest to help me and the fast and detailed answers!
Sorry for my bad english...

@Trying_to_learn:
The 2 nodemcu (ESP8266) send every 10 seconds data (MQTT-Protocol) to my RPi3 (MQTT Server) where I installed Mosquitto and Node Red too.
I use Node Red to display the data on the dashboard. I have connected a monitor to my RPi.

@hotNipi @kuema :
At the moment my chart display the data of the last 12hour.
I don´t need live data so I will try to increase the interval on my ESP8266. And I will search a tutorial how I can aggregate the riceived data.

I would leave the ESP8266 devices as is and do the data aggregation in Node-RED.
10-15s send interval is fine and you can detect early when a sensor is malfunctioning or no longer sending data.

You have already mentioned the aggregator node. I can recommend it as I am using it myself. In fact I did a PR on that one to implement the "Submit one message per topic" feature. :nerd_face:

If you can, get another machine to look at the dashboard of the RPI and see if that reduced the CPU load.

On the second machine enter the IP address of the RPI and....

eg:
the.ip.address.of:1880/#/ui

Hello!
@kuema , @Trying_to_learn:
Thank you for your inputs. I will try to implement it.

what would be the ideal number of data points such that it doesn't heavily impact the browser performance?

That depends on the size (width) of your graph. It doesn't make much sense to have more data points than pixels available. :grin:

As a rule of thumb I would say no more than 1000 data points, but I'd rather calculate this dynamically. So downscaling/aggregating your data to the time range and display width is always a good idea.

As an inspiration, Grafana is doing that quite nicely.

Would the cause of slow response of browser be the number of sensors as well?

I currently have 5 sensors which is displaying on my dashboard with 5 gauges and charts.

It depends on how often you send new data points to your dashboard.

It also depends on your hardware. Since gauges and charts are animated, these can cause a slow down.

You could use the delay node to employ some rate limiting.

thanks . I have solved my issue by increasing the interval time to send new data point on my timestamp nodes