-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Charts Cause Browser Page Crashes #38
Comments
Has worked fine here for several days. I have 2 pages, page 1 with six charts with one input each, and page 2 with one chart with two inputs, all being fed via MQTT, and same as you I'm viewing them on Win 10. |
I have seen this sort or hang myself with the Chart node - so there is definitely something here to investigate. Smells of a memory leak in the chart node. |
I`ve got a similar issue. When adding chart nodes my RAM usage for the browser keeps filling up constantly ( Up to 2GB and more) and at some point it crashed. |
Right now the server end of the chart holds ALL the previous values until they time out (based on the X Range window) - AND worse still sends them all to the client every time new data arrives... Options are
|
Good suggestions Dave, thank you. I'm in the testing phase of my project Kind Regards On 8 August 2016 at 18:42, Dave Conway-Jones [email protected]
|
Doesn't seem that sensible to have to resend all the data on each update - wouldn't it be better to let the browser accumulate the data? I've used browser-based charts that can easily handle hundreds of thousands of data points without breaking into a sweat. Indeed, Grafana is a good example, I've thrown some really silly amounts of data at that (multiple lines with 40sec intervals for 12m). The old UI graph used to grind the browser to a halt if you had more than about 50 data points so things have at least moved in the right direction! |
Won't you want to see data that arrived while the browser wasn't connected ? So it has to be accumulated at the host end as well. |
Hmm, good point, didn't think that through did I! Then there is also the problem of multiple connected clients. How would that work. Things could get complex very quickly. That would seem to indicate that the chart node should be kept simple, maybe having an optional limit added to the config for the node? There almost certainly isn't a one-size-fits-all solution here since the reason for a chart can vary so wildly. However, it would seem sensible for the standard chart node to be fairly simple with a direction to people to craft their own chart using a Template if they want something more complex. |
Similar situation here. I have 2 graphs that collect temperature data (every 30 seconds 2 new values) and the graphs are configured to show data collected fro 24 hours. When I first open the page it sits at some 35M of memory use (Chrome Version 52.0.2743.82 (64-bit) on Red Hat Enterprise Linux 7.2). This grows radically after opening all the tabs a few times to 150MB and when left sitting idle in the background continues to grow to now 260MB, 30 minutes after opening the page. As it clearly seems to be a memory usage issue - shouldn't we rename the Issue title to "Possible memory leak"? |
I don't really understand why all data points get sent for each new data point? Why isn't an array of historical/cached data sent during the initial websocket connection, and then only new data points get broadcast? Is there no mechanism on the browser side for appending new points and discarding those older than X? That kind of logic could live in the chart node, right?
You could probably guess this but imposing arbitrary window size limits to 'fix' this issue would make dashboard charts totally worthless for my group and, I suspect, many others as well. Similarly, we would frown upon range reduction (that should really be delegated back to the user to specify an appropriate technique). |
After a few days of testing, I can reliably reproduce browser crashes by opening a tab with 2 graphs shown, collecting data at 2 values per minute, displaying 24 hours range. After roundabout 2-3 hours memory consumption on Chrome goes beyond 3GB(!) and the browser page "aw, snaps".
|
For a production system, we MUST have a limit on the number of points stored; as well as on the time. I just ran a graph which by mistake swallowed 150000 historical entries, an it crashed both node and the browser; and worse lost my flow changes, and because it did it every startup, i had to physically disconnect the data source to then run up to modify the flow before reconnecting. |
A workaround: with the current chart, you can 'restore' data to it; repeatedly. This actually means you can keep your own store of x/y points, and push them to the chart replacing previous points, so avoiding the issue (any also giving you full control of 'X'!! - and you could 'thin' the points before restoring to save browser mem/transfers). example in this flow: http://flows.nodered.org/flow/af9f48033bbf56a2282f3c7f41d6500b . |
Now pushed to master - 0fe76c2 |
This still seems to be an issue for me. Anyone else on the same boat? (I am running the latest updates) |
@robertatdi : check it's not the admin page stealing all your ram - when I have some diagnostics running on an admin page, it tends to use an every increasing amount until it crashes or I refresh. |
The ram usage seems not to be the only problem. My google Chrome (tested only in linux) also starts slurping tons of CPU when a tab with a chart is visible. |
I've been using a page with either 1 chart with 2 inputs or 2 charts with one input showing MQTT-derived data for an hour at a time (updated every 10 secs). After several hours, the pages 'snap' on both Chrome and Firefox on Win 10.
The text was updated successfully, but these errors were encountered: