home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.03k stars 28.28k forks source link

Upgrade to 2024.5.1 : High memory and CPU usage #116872

Open jymorel opened 1 week ago

jymorel commented 1 week ago

The problem

HAOS. RPI4 8 Gb. After upgrade from 2024.4.4 to 2024.5.1, I see a significant increase of memory and cpu usage. (Memory : 10 -->25%, CPU 25 --> 50). Downgrading to 2024.4.4 solved the issue. 2024.4.4: HAOS_2024 4 4 2024.5.1: HAOS_2024 5 1

What version of Home Assistant Core has the issue?

2024.5.1

What was the last working version of Home Assistant Core?

2024.4.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

bdraco commented 1 week ago

Please follow the instructions at https://community.home-assistant.io/t/2024-5-tracking-down-instability-issues-caused-by-integrations/724441 and post a callgrind file

jymorel commented 1 week ago

so I have installed again version 2024.5.1yesterday evening at about 9:00pm. You will find attached the history of CPU and memory usage. And a callgrind file. Thank you HAOS_2024 5 1_2024-05-06 callgrind.out.1715013163860053.txt

bdraco commented 1 week ago

Looks like a run-away template

Screenshot 2024-05-06 at 1 23 03 PM
bdraco commented 1 week ago

Please follow the instructions at https://community.home-assistant.io/t/2024-5-tracking-down-instability-issues-caused-by-integrations/724441 to identify it

jymorel commented 1 week ago

Idid that and I looked at the log. I found 2 templates used in sensors for getting lists of last seen devices and unavailable devices with more than 100000 renders ... But strangely, cpu and memory usage decreased significantly and returned to normal after installing 2024.5.2...? Seems to be stable now. HA 2024 5 2_installation

jymorel commented 1 week ago

fixed by HA 2024 5 2 before and after upgrade to 2024.5.2.

bdraco commented 1 week ago

I'm not 100% sure that this problem is fixed, as there wasn't anything specifically for templates in 2024.5.2. Perhaps it was the statistics fix? Do you use the statistics integration?

If you send another callgrind file. I'll also take a look and see if there's anything obvious going on that might cause the problem to reoccur.

jymorel commented 1 week ago

No I don’t use the statistics integration. Only 1 history_stats sensor for testing. Ok attached a new callgrind file. FYI, not a best practise for testing, but I installed go2rtc and alexa media player updates at the same time as HA 2024.5.2 update … callgrind.out.1715104561015525.txt