neolink icon indicating copy to clipboard operation
neolink copied to clipboard

CPU usage increases to 100%

Open barttim-oss opened this issue 1 year ago • 7 comments

Describe the bug I have the application as an add-on in my HomeAssistant, unfortunately the CPU usage increases constantly until it eventually reaches 100% and blocks my entire HomeAssistant server

To Reproduce

  1. Launch Neolink: with only mqtt on
  2. wait an hour

Versions Neolink software: neolink-latest Reolink camera model and firmware: 4x Argus 3 Pro HA-Hardware: PC with 13th Gen Intel® Core™ i9-13900H, HA gets 12 of the Cores

Can you help me? What do you need to find the Isue

barttim-oss avatar Nov 06 '24 10:11 barttim-oss

Same here.... funny enough I have a similiar issue on both ends, on the Broker side (https://github.com/eclipse-mosquitto/mosquitto/issues/2807) and just now observed for the first time on the client side (neolink with the same setting as yours with just mqtt enabled). I have no idea, yet but investigating...

MatthiasPetermann avatar Nov 24 '24 12:11 MatthiasPetermann

A small update on this: In the meantime, I have switched my MQTT broker from Mosquitto to NATS and can confirm that this issue also occurs with NATS. My Neolink configuration is as follows:

[mqtt]
broker_addr = "10.0.0.14"
port = 1883
credentials = [ "neolink", "**********"]
enable_motion = true

[[cameras]]
name = "Einfahrt"
username = "admin"
password = "*********"
uid = "***************"
  [cameras.mqtt]
  enable_motion = true
  enable_preview = true
  preview_update = 2000
  [cameras.pause]
  on_motion = true
  timeout = 2.1

[[cameras]]
name = "Garten"
username = "admin"
password = "*********"
uid = "*********************"
  [cameras.mqtt]
  enable_motion = true
  enable_preview = true
  preview_update = 2000
  [cameras.pause]
  on_motion = true
  timeout = 2.1

I had to restart neolink to bring it back to normal operation. Next time - I guess this will happen in the next 24 hours - I am prepared to run a dtrace script and hopefully can prepare some detailed logs which function consumes most cpu time to narrow it down.

MatthiasPetermann avatar Nov 28 '24 02:11 MatthiasPetermann

Having the same problem. After a while of running addon it suddelny turn to 100% CPU. Its difficult to get logs down, since something shows "fetching problems".

Here is the debug log I managed to download

Running: /run.sh --- VERSIONS --- add-on version: 0.0.1 [2025-01-22T09:56:03Z INFO neolink] Neolink c3353591ae1e64113da420d3a3a9567b6976b4e4 release neolink version: neolink 0.6.3-rc.3 neolink mode: mqtt neolink log: debug ATTENTION: if you expected a newer Neolink version, please reinstall this Add-on! --- Neolink --- [2025-01-22T09:56:03Z INFO neolink] Neolink c3353591ae1e64113da420d3a3a9567b6976b4e4 release [2025-01-22T09:56:03Z DEBUG neolink::mqtt::mqttc] MQTT Published Startup [2025-01-22T09:56:03Z INFO neolink::mqtt] DuffusPV: MQTT Starting [2025-01-22T09:56:03Z INFO neolink::utils] DuffusPV: Connecting to camera at UID: 9NotForU [2025-01-22T09:56:03Z INFO neolink_core::bc_protocol] DuffusPV: Trying local discovery [2025-01-22T09:56:03Z DEBUG neolink_core::bc_protocol::connection::discovery] Broadcasting to: [(255.255.255.255, 2015), (255.255.255.255, 2018), (172.30.33.255, 2015), (172.30.33.255, 2018)] [2025-01-22T09:56:03Z DEBUG neolink_core::bc_protocol::connection::discovery] Also sending to [] [2025-01-22T09:56:03Z DEBUG neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 255.255.255.255:2015 with tid: 69 [2025-01-22T09:56:03Z DEBUG neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 255.255.255.255:2018 with tid: 67 [2025-01-22T09:56:03Z DEBUG neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.30.33.255:2015 with tid: 216 [2025-01-22T09:56:03Z DEBUG neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.30.33.255:2018 with tid: 93 [2025-01-22T09:56:03Z DEBUG neolink::mqtt::discovery] Enabling MQTT discovery for DuffusPV [2025-01-22T09:56:03Z INFO neolink::mqtt::discovery] Enabled MQTT discovery for DuffusPV with friendly name Duffus Pv [2025-01-22T09:56:03Z DEBUG neolink::mqtt] Listening to message on DuffusPV [2025-01-22T09:56:03Z ERROR neolink::mqtt::mqttc] MQTT Client Connection Failed: MQTT connection dropped Caused by: 0: Mqtt state: Io error: Custom { kind: ConnectionAborted, error: "connection closed by peer" } 1: Io error: Custom { kind: ConnectionAborted, error: "connection closed by peer" } 2: connection closed by peer [2025-01-22T09:56:03Z DEBUG neolink_core::bc_protocol::connection::discovery] Registering 172.30.33.8:53601 to reolink [2025-01-22T09:56:05Z DEBUG neolink::mqtt::mqttc] MQTT Published Startup [2025-01-22T09:56:05Z INFO neolink_core::bc_protocol] DuffusPV: Trying remote discovery [2025-01-22T09:56:06Z INFO neolink_core::bc_protocol] DuffusPV: Trying map discovery [2025-01-22T09:56:06Z INFO neolink_core::bc_protocol] DuffusPV: Trying relay discovery [2025-01-22T09:56:07Z INFO neolink_core::bc_protocol] DuffusPV: Remote discovery success 9527000I2EI67DR1 at 192.168.0.61:52995 [2025-01-22T09:56:07Z INFO neolink::utils] DuffusPV: Logging in [2025-01-22T09:56:08Z DEBUG neolink_core::bc_protocol::login] Populating abilities [2025-01-22T09:56:08Z DEBUG neolink_core::bc_protocol::abilityinfo] Abilities: <AbilityInfo><userName>admin</userName><subModule><abilityValue>general_rw, norm_rw, version_ro, uid_ro, autoReboot_rw, restore_rw, reboot_rw, shutdown_rw, dst_rw, log_ro, performance_ro, upgrade_rw, export_rw, import_rw, bootPwd_rw</abilityValue></subModule><subModule><abilityValue>port_rw, dns_rw, email_rw, ftp_rw, ftpSchedule_rw, ipFilter_rw, localLink_rw, pppoe_rw, upnp_rw, wifi_rw, ntp_rw, netStatus_rw, ptop_rw, autontp_rw</abilityValue></subModule><subModule><abilityValue>rfAlarm_rw</abilityValue></subModule><subModule><channelId>0</channelId><abilityValue>motion_rw</abilityValue></subModule><subModule><channelId>0</channelId><abilityValue>ispBasic_rw, ispAdvance_rw</abilityValue></subModule><subModule><abilityValue>user_rw, userOnline_rw, bootPwd_rw</abilityValue></subModule><PTZ><subModule><abilityValue>control_rw, preset_rw, cruise_rw, track_rw, decoder_rw, ptzInfo_ro</abilityValue></subModule></PTZ><subModule><channelId>0</channelId><abilityValue>preview_rw, compress_rw, snap_rw, rtsp_rw, streamTable_ro</abilityValue></subModule></AbilityInfo> [2025-01-22T09:56:08Z INFO neolink::utils] DuffusPV: Connected and logged in [2025-01-22T09:56:10Z INFO neolink::common::camthread] DuffusPV: Camera time is already set: 2025-01-22 10:56:05.0 -01:00:00 [2025-01-22T09:56:12Z INFO neolink::common::neocam] DuffusPV: Model Argus 4 Pro [2025-01-22T09:56:12Z INFO neolink::common::neocam] DuffusPV: Firmware Version v3.0.0.3867_24072601 [2025-01-22T09:56:12Z DEBUG neolink::common::instance] - Task Error: Camera responded with Service Unavaliable: Msg of type 438 returned code 405

Imaduffus avatar Jan 22 '25 13:01 Imaduffus

Hello, same here. I think I'll make an automation in HA to restart the add-on until there is a solution...

Zeroth25 avatar Feb 23 '25 17:02 Zeroth25

You can run neolink with docker and limit resources to it like this:

docker run --memory 2048m  --cpus=2   quantumentangledandy/neolink /usr/local/bin/neolink mqtt-rtsp --config /etc/neolink.toml

pastukhov avatar Mar 01 '25 06:03 pastukhov

I have the same problem with my Reolink Argus camera. It disconnects after 30 minutes and then the CPU of the integration goes up to nearly 100%. My HomeAssistant VM (running under Proxmox) is than also highly impacted.

HarryBiedermann avatar Sep 08 '25 08:09 HarryBiedermann

Facing this issue too with Argus Eco

giglecald avatar Oct 05 '25 07:10 giglecald