ioBroker / ioBroker.vis-2

Next generation visualisation for ioBroker platform.
Other
28 stars 4 forks source link

Vis response-time constantly decreasing over time, >3s lag #66

Open seb2010 opened 2 years ago

seb2010 commented 2 years ago

Describe the bug
I am running a Vis-Visualization on a Galaxy Tab A7 with 3GB RAM in a Fully Kiosk Browser Instance (utilizing the Chromium Web-Engine) and to validate the issue also in a Chrome App instance. The Vis is running 24/7, the tablet is mounted to a wall.

The issue is, that the Vis gets irresponsive after some time. I already am reloading the View every 60 minutes, but also 30 minutes seems to be long enough to somehow slow thing significantly down. This translates into multiple seconds long lags from button pushes to the actual result (is reacting instantly when doing it in a new instance on a laptop or after reloading the Vis). This also translates into slow build-ups of Dialogs activated by controls in the Vis. One can see the actual items of the Dialogs View at the top left, but it takes some seconds for the items to jump into the Dialog-"window".

I think it must have something to do with the handling fo incoming messages from iobroker to updates items in the View. Maybe over time, this updates pollute the model behind it it makes it that slow.

As responsiveness is one major key quality for a home-automation system, Visualization should maintain LONGTERM performance when interacting with the frontend. I am very confident, that this is not an issue with the Browser it is running in. It might be connected to the overall performance of the underlying hardware of the displaing device, but I already experimented a lot with software and hardware in this regard.

To Reproduce
Have a not so simple Visualisation, with various live-data running for a while and look after the responsivess of the view and dialog pop-ups (Container-Dialog).

Expected behavior
Same responsiveness to frontend interaction as after a fresh reload of the Visualization. Have dialogs be displayed instantly with the correct formatting and alignement of objects.

Screenshots & Logfiles
not yet available

Versions:

Additional context
Pi4 4GB, WLAN connection on maximum signal strength, stripped down Samsung Galaxy A7 3GB tablet (solely used for Vis-display)

cratoo commented 2 years ago

@seb2010 could it be, that you're using embedded javascript in your (string) widget(s)? See my issue ioBroker/ioBroker.vis-2#65

seb2010 commented 2 years ago

Yes, that is totally right. I am using those heavily. So +1

seb2010 commented 2 years ago

Es scheint so, als wäre für diesen Fall "htmlRefresh" unter "vis.binds.basic" in der "index.html" dafür verantwortlich, mit welchem für ein HTML-Widget die Aktualisierung des Widgets mit der im Vis-Editor unter "Updatezeit(ms):" eingestellten Refreshzeit durchgeführt wird. Ich hatte die aus irgendeinem Grund auf 2000ms stehen. Wenn man den Body der htmlRefresh-Funktion auskommentiert oder die Refreshzeit auf 0 stellt, tritt das Problem nicht auf. Mit aktiver Funktion entsteht ein Memory-leak. Ich denke, dass der Timer von setInterval bei der Aktualisierung des Widgets für ein Variablen-Binding nicht korrekt gelöscht wird und daher die Garbage-Collection das Object nicht erfasst. Das könnte auch auf andere setInterval-Timer in Kombination mit Variablen-Bindings zutreffen.

Apollon77 commented 1 year ago

@seb: Please recheck with vis 2.0 ... Does it happen there too?

seb2010 commented 1 year ago

@Apollon77 Ich habe das ganze jetzt mit VIS v2.0.16 getestet. Mit einer Updatezeit unter "Allgemein" von 2000ms werden gar keine Daten angezeigt (die Inlinewerte zeigen "NaN"). Wenn ich die Updatezeit auf 10000ms erhöhe, werden die Widgets mit Daten initial gefüllt, Nach Ablauf der 10s werden jedoch alle Werte wieder gelöscht und die Widgets zeigen wieder "NaN". Der Updatemechanismus scheint nicht zu funktionieren.