The data views of the console freeze after receiving a lot of events.
Freezing data views
Data views being stable regardless of the amount of events received
v3.5.8 and older
The problem is likely caused by the redux store being filled considerably when the console is subscribed to an event source. Especially since the packet broker update, it will receive a lot of data per event which easily sucks up memory. My ideas to fix this are:
localStorage instead of in the redux store. We could then only reference the event data in the redux store. This is assumption-based buy maybe the localStorage can handle large amounts of data better.@bafonins what do you think?
Manual testing.
Yes.
The problem is likely caused by the redux store being filled considerably when the console is subscribed to an event source. Especially since the packet broker update, it will receive a lot of data per event which easily sucks up memory.
Redux store is certainly related here, but the main problem is rendering. After https://github.com/TheThingsNetwork/lorawan-stack/pull/2477#discussion_r421182736 I removed the limit for the number events being rendered in the events view.
Your solution looks fine, but indeed localStorage requires some experimentation
So after working on this for a bit, I think the solution here is threefold:
react-window to only render the list elements that are currently visibleUnfortunately, this issue persists. Albeit, the event views can handle more load now but there's still a certain threshold of event count and frequency that will cause lag and freezes.
I will reintroduce a maximum amount of events as a quick remedy until we can fine-tune this further.
Is this in progress?
This is not in progress anymore. I had to close two attempts to improve this because it was not verifiable that these solutions helped. The situation improved significantly after virtualizing the lists via #3229 but there's still a point of failure when the event view receives thousands of events. I somehow missed opening a PR that will solve this by limiting the number of events displayed in the console. Will do that now.
I somehow missed opening a PR that will solve this by limiting the number of events displayed in the console. Will do that now.
-> #3470
Also, these two comments provide some insight into what I tried to do and what issues I had:
https://github.com/TheThingsNetwork/lorawan-stack/pull/3329#issuecomment-712410891
https://github.com/TheThingsNetwork/lorawan-stack/pull/3330#issuecomment-712937573
Hopefully, this will help future attempts to address the issue more thoroughly.
Reopening this since the issue still remains when showing events for applications with ~50+ end devices (this depends on how frequent the end devices send or receive data). There are some ideas to solve this in this comment already.
Let's use this thread to discuss possible other ways to solve this issue. Please also see https://github.com/TheThingsNetwork/lorawan-stack/pull/3329#issuecomment-712410891 and https://github.com/TheThingsNetwork/lorawan-stack/pull/3330#issuecomment-712937573
@kschiffer what's the status here?
This one is tricky. Solving this properly is blocked on #3817. An intermediate fix is described here https://github.com/TheThingsNetwork/lorawan-stack/issues/2231#issuecomment-779659836.聽
To add this, we need to be able to filter event streams on event types, which is one of the things that will be added by the Event Server TheThingsIndustries/lorawan-stack#1804.
So either way there does not seem to be a quick remedy. The only other thing I can think of as preliminary fix is to automatically close the event stream and show an explanation message if it reaches a events/second threshold.
So this needs to be removed from the current milestone, since it's not actionable right now as we need a decision on this first.