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
Prune charts data #73
Comments
add more ram :D i mean, you can't expect a permanently-open live view to show you a boundless amount of data, regardless of the tech you use; the user's browser cannot serve as a replacement for a server-side time-series database, after all. and an overview with 1e9 datapoints would be unwise to feed to the client or to a js chart - especially one that has to be continuously re-rendered. you could potentially save some memory by using typed arrays for the input data, but that's just kicking the can down the road. re-plotting 1e6 datapoints on every event (which is what uPlot's i'm not sure i can give you any terribly insightful advice that isn't obvious.
i have a half-baked demo of an overview & detail chart linked together [3], but it's all client-side. you would need to involve the server for it to solve this perf issue. [1] https://github.com/leeoniya/uPlot#166650-point-bench-httpsleeoniyagithubiouplotbenchuplothtml |
sorry, i think i stopped reading after the first sentence of this issue. ignore my re-explaining of the obvious things you already said. time for coffee, obviously. |
Thanks @leeoniya. I think the simplest for now is to keep only the last N points or so. We will figure out the best value for N as we move forward. I will take a look at your examples and see if I can come up with something. |
@josevalim We could consider a sliding time window, too. Rather than keep the last N points, we could drop points where |
@mcrumm my concern with window size is that it won't be enough for apps doing many req/s. So having an absolute value works best. However if the sliding window is easier, then let's do that. |
Good point. No, max values is likely simpler, so let's start there. 👍 |
RE: https://twitter.com/mcrumm/status/1251191099512598528 i'll offer my $0.02. and please don't take this as me trying to keep uPlot in live_dashboard, but simply as my experience with benchmarking more libs than i ever thought i'd need to [1]. i have yet to encounter an SVG-based charting lib that comes anywhere close in performance to Canvas based libs for large datasets and interactivity. i love SVG more than canvas and would be ecstatic to be proven wrong, but thus far the performance gap is simply too large. i'd be very curious to see how contex-charts performs relative to everything else i've tested, not just in static chart rendering but live streams, too. another new lib in this space is https://github.com/Rich-Harris/pancake i think that any server-side charting solution will have to reduce SVG datapoints drastically on the server or output a png rather than xml. |
Thanks @leeoniya! I just wanted to mention some of the alternatives we considered, while we still had some Twitter hype going :) I'm extremely happy with what we have so far, and once we set some limits in the dashboard to improve the experience for very large datasets, it will be even better. Thanks for all your continued help! |
To be clear: this is an issue about pruning data on the client. Whatever we do in the server is a separate issue from this one. |
Closing in favor of PR. |
So someone reported that keeping the "Metrics" tab open after a long period of time ended-up consuming 5GB of memory. This makes sense, given that we keep pushing data to charts forever and ever. I am wondering if we should put an upper limit on the number of elements on the chart and start pruning old data once we go past N elements, for example, N = 10000.
Hi @leeoniya, if you don't mind, do you have any insights on what we can do here?
The text was updated successfully, but these errors were encountered: