Modern UI almost crashes on large number of devices

Jithin4 years ago

Hi Anton,

Thanks for this awesome project. Recently we started customizing traccar modern UI for one of our projects. It was working fine during development but when we loaded all of our devices (over 1500), the UI almost crashes & the entire system got stuck. Looking at the code, we conclude that loading all the devices into the store & frequently updating the same might be the cause of this behavior. Would like to know your inference on it and we are ready to contribute the code changes that might be required.

Anton Tananaev4 years ago

I think map clustering is needed.

Jithin4 years ago

Thanks for responding. We will look into that and give an update

Jithin4 years ago

Hi Anton,

We just integrated the Mapbox clustering into code. It is still hanging the system. We found that frequent redux store updates and associated map updates are causing the issue. So we tried to reduce the frequency of store updates by using redux-batched-subscribe using lodash's throttle function. Though we finally we managed to get the UI render somewhat smoothly with a throttle period of 10sec, the system still heating up while the page is running.

Anton Tananaev4 years ago

We just need to do clustering at the store level, so it doesn't recalculate everything every time.