sanderdw / hassio-addons

DSMR Reader Datalogger and Metabase Home Assistant Add-ons
https://community.home-assistant.io/search?q=%40sanderdw%20%23home-assistant-os
Other
54 stars 14 forks source link

High CPU load (>90%) #28

Closed hugodejong closed 2 years ago

hugodejong commented 2 years ago

Since a recent restart of the add-on, I've been seeing a CPU load that's way too high to be normal:

image

Data is coming into HA through MQTT and the web interface is available, so everything seems to work. The add-on log shows a lot of this:

`127.0.0.1 - - [17/Jan/2022:22:22:14 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:22:19 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:22:24 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:22:30 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:22:35 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:22:40 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:22:46 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:22:51 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:22:56 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:23:01 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:23:07 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:23:12 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:23:17 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:23:22 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:23:28 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"

127.0.0.1 - - [17/Jan/2022:22:23:33 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-"`

Currently running v0.7.3.

I've tried:

Sholofly commented 2 years ago

Yeah, definately too high: image

ecoenjaerts commented 2 years ago

Also see a sudden rise in CPU usage. Add on log contains multiple Errors. I am not an expert at all, but maybe this helps.

127.0.0.1 - - [18/Jan/2022:08:10:59 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:11:04 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:11:09 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:11:14 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:11:20 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:11:25 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 2022-01-18 08:11:27,547 ERROR schedule execute_scheduled_processes 37 | (PermissionError) dsmr_backup.services.backup.run errored: [Errno 13] Permission denied: '/backup/dsmrreader/dsmrreader-postgresql-backup-Tuesday.sql' 127.0.0.1 - - [18/Jan/2022:08:11:30 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:11:36 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:11:42 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:11:47 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:11:52 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:11:57 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 2022-01-18 08:11:58,101 ERROR schedule execute_scheduled_processes 37 | (PermissionError) dsmr_backup.services.backup.run errored: [Errno 13] Permission denied: '/backup/dsmrreader/dsmrreader-postgresql-backup-Tuesday.sql' 127.0.0.1 - - [18/Jan/2022:08:12:03 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:12:08 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:12:13 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:12:18 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:08:12:24 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 2022-01-18 08:12:28,979 ERROR schedule execute_scheduled_processes 37 | (PermissionError) dsmr_backup.services.backup.run errored: [Errno 13] Permission denied: '/backup/dsmrreader/dsmrreader-postgresql-backup-Tuesday.sql'

hugodejong commented 2 years ago

Also seeing these PermissionErrors now.

127.0.0.1 - - [18/Jan/2022:09:55:07 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:09:55:13 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:09:55:18 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:09:55:23 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:09:55:28 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:09:55:34 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 2022-01-18 09:55:34,757 ERROR schedule execute_scheduled_processes 37 | (PermissionError) dsmr_backup.services.backup.run errored: [Errno 13] Permission denied: '/backup/dsmrreader/dsmrreader-postgresql-backup-Tuesday.sql' [2022-01-18 09:55:39 +0100] [637990] [INFO] Autorestarting worker after current request. 127.0.0.1 - - [18/Jan/2022:09:55:39 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" [2022-01-18 09:55:39 +0100] [637990] [INFO] Worker exiting (pid: 637990) [2022-01-18 09:55:40 +0100] [680261] [INFO] Booting worker with pid: 680261 127.0.0.1 - - [18/Jan/2022:09:55:46 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:09:55:51 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:09:55:57 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 127.0.0.1 - - [18/Jan/2022:09:56:02 +0100] "GET /about HTTP/1.1" 200 14772 "-" "curl/7.79.1" "-" 2022-01-18 09:56:05,764 ERROR schedule execute_scheduled_processes 37 | (PermissionError) dsmr_backup.services.backup.run errored: [Errno 13] Permission denied: '/backup/dsmrreader/dsmrreader-postgresql-backup-Tuesday.sql'

sanderdw commented 2 years ago

Not tested well enough, i see... To fix these errors on the new set-up i need some extra time so in the mean time i published DSMR-reader 0.7.3 which is just the previous working config. Let me know if that fixes it for now.

Sholofly commented 2 years ago

0.7.3 was already the latest version, wasn't it? I don't see updates now...

sanderdw commented 2 years ago

I need to wake up, yes indeed DSMR-reader 0.7.4 👍

Sholofly commented 2 years ago

That looks good!

image

Alfagek commented 2 years ago

Thanks for the quick “fix” @sanderdw the new-old version 0.7.4 works again with almost no cpu power again

hugodejong commented 2 years ago

My HA has not detected the update yet, will let you know whether it has fixed it. Is there a trick to have HA check for add-on updates? :)

hugodejong commented 2 years ago

Works like a dream again. Thank you @sanderdw for the speedy solve!