miguelangel-nubla / videoP2Proxy

Proxy to enable P2P only cameras to work with standard protocols.
MIT License
164 stars 44 forks source link

100% CPU usage after a time and unable to get RTSP stream anymore #5

Open humpedli opened 5 years ago

humpedli commented 5 years ago

First of all, thank you for your solution, it's very helpful. I am using your code in docker container: https://github.com/humpedli/docker-xiaomi-aqara-rtsp

Unfortunately I discovered that the CPU usage is increasing to 100% after a time and I am unable to get RTSP stream anymore. This time means like 8-16 hours. Could you please suggest me something how to debug this issue? There is no error on console output.

Grayda commented 5 years ago

I'm running this in a dedicated VM (to stop the 100% CPU bug from taking down my home server) and my workaround has been to have a cron script that kills the script and re-runs it every 3 hours. It means ~3 seconds of downtime every 3 hours, which is fine by me.

I did have a poke through the code, but I know nothing about C (I'm a PHP / Node.js guy) so I can't help much there, other than thinking that it might be an out of control loop or something.