Conversation
|
Wow that's a huge improvement, nice one |
|
This made a huge improvement for me, the process was consistently using a full core. Thank you! But now that this isn't a bottleneck, I find that my unifi console is unresponsive and goes offline, so maybe there needs to be some backoff of ratelimiting of the API? |
Are there any items in your download queue when the console goes offline or is it just the missing events checker running at that time? |
|
In regards to that other PR, apologies for not figuring that all out, been busy the past few weeks |
|
Sorry to leave a complaint and then disappear. I now think this change is unrelated to what I've been experiencing. I went back to the 0.14.0 version and I'm still experiencing issues around the missing event detection. So presumably something on my side. I did semi recently introduce 2 new 4k cameras to my existing 2K*6. I'll continue to investigate and play around. I'll also try that other PR for reduce the span at which missing event detection runs. Heatmaps is interesting! I've disabled them because I don't need them, what do you think the connection might be? Or is just that they are resource intensive in their own. (And sorry if this is cluttering the discussion, happy to move it to somewhere else) |
|
The information for heatmaps says it is resource intensive and i don't think it is worth keeping the feature on unless you need it. Turning it off did resolve my crashing issues but i also have filled the camera capacity. If you would like to use the other pull request, i pushed another commit which fixes an issue with missed events when the downloader fails and makes the failures happen less often. I didn't originally push it because that pull request won't actually be merged. It does work but the final solution will be quite different. |
|
Thanks! I've disabled heatmaps and have been`` running with pr221 for 12 hours and everything is snappy and unifi-protect-backup is using little cpu. Not sure I still need the experimental downloader. |
|
At some point could you try enabling the heat maps again and see how it behaves while running the PR. I'd like to know if it's UPB that's causing issues |
|
Good idea, I've reenabled it and have been running a few different scenarios over the last few days. I'll report back with what caused problems / what didn't. |
|
Ok, I've been having trouble reproducing the problem, but here's the state change so far. I thought I'd share so you can suggest things to try / things to include in my table. "local" is when I built locally from github with pr222 included. pr221 is when I built from the #222 branch. Everything since For some reason I had automatic archiving from the unifi side to a smaba server turned on for two cameras. I don't need it, but I tried turning it off at the same time I turned off heatmaps.
|
|
Sorry! I think this has nothing to do with unifi-protect-backup but with another application I've been developing that reads from the unifi protect RTSP streams. I forgot! After looking at other logs around the time things weren't going well, I see a that there were a lot of cycles of my personal application connecting/reconnecting as I was developing. I haven't worked on it since the 20th and that's why things have been working well! I'll probably setup go2rtc or something to produce less load on unifi protect. |
The purge events were taking 24 seconds to complete for each event. This is strange due to the actual purge command taking around 2 seconds.
The issue is due to the missing events loop taking 23 seconds to complete. The next purge event can't start while this is still active. Moving the sets combination from the if statement to outside the loop reduces this to 0.05 seconds which allows purge events to run on time.
This also reduces the total runtime for the missing events checker on my Raspberry Pi from 55 mins to 2 mins and 36 seconds.