core: High CPU and memory usage under 0.108.0

The problem

Since the installation of HA version 0.108.0 the CPU and memory usage in my system grows. I have restarted several times (HA and the raspberry) but this does not fix nothing.

This graph shows the difference from 0.107.7 to 0.108.0:

image

You can see the low CPU in blue and the memory stable at about 30% in red until the installation of 0.108.0. Since then the memory and the CPU grows in the time. I have restarted it several times without luck, as you see in the graph.

My first idea is to go back to 0.107.7 but I prefer to comment this here because maybe there is a bug and I can help giving information.

Environment

  • Home Assistant Core release with the issue: 0.108.0
  • Last working Home Assistant Core release (if known): 0.107.7
  • Operating environment (Home Assistant/Supervised/Docker/venv): Hass.io
  • Integration causing this issue: Unknown
  • Link to integration documentation on our website: Unknown

Problem-relevant configuration.yaml

I don’t know what to attach. My complete configuration?

Traceback/Error logs

I can’t see any error, only the Brother that can’t find the powered off printer, but this was the same in 0.107.7.

2020-04-09 08:39:56 ERROR (MainThread) [homeassistant.components.brother] Error fetching brother data: No SNMP response received before timeout
2020-04-09 08:39:56 WARNING (MainThread) [homeassistant.config_entries] Config entry for brother not ready yet. Retrying in 80 seconds.

Additional information

I have some custom integration, but they were there in earlier versions too:

  • badnest
  • nodered
  • hacs

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 82 (15 by maintainers)

Most upvoted comments

I had this same issue as well, starting in 0.108.0 and the changes in 0.108.6 did fix it for me.

The issue then returned in 0.109.0 and has consisted through 0.110.x. Both CPU and RAM will creep up and then eventually bring HA to a standstill until rebooted.

1,5% percent of difference between having and not having snmp queries in background… what hardware are you on where it matters? 😉

@D43m0n666 This was a Data Update Coordinator issue and affected all integrations using it.

I re-enabled Brother. I see increasing CPU-usage. This seems overall fine, the message:

Apr 16 15:55:22 hass hass[593]: 2020-04-16 15:55:22 ERROR (MainThread) [homeassistant.components.brother] Error fetching brother data: No SNMP response received before timeout
Apr 16 15:55:22 hass hass[593]: 2020-04-16 15:55:22 WARNING (MainThread) [homeassistant.config_entries] Config entry for brother not ready yet. Retrying in 80 seconds.
Apr 16 15:57:10 hass hass[593]: 2020-04-16 15:57:10 ERROR (MainThread) [homeassistant.components.brother] Error fetching brother data: No SNMP response received before timeout
Apr 16 15:57:10 hass hass[593]: 2020-04-16 15:57:10 WARNING (MainThread) [homeassistant.config_entries] Config entry for brother not ready yet. Retrying in 80 seconds.
Apr 16 15:58:59 hass hass[593]: 2020-04-16 15:58:59 ERROR (MainThread) [homeassistant.components.brother] Error fetching brother data: No SNMP response received before timeout
Apr 16 15:58:59 hass hass[593]: 2020-04-16 15:58:59 WARNING (MainThread) [homeassistant.config_entries] Config entry for brother not ready yet. Retrying in 80 seconds.

OK. I enabled debug logs on brother integration:

Apr 16 16:00:48 hass hass[593]: 2020-04-16 16:00:48 ERROR (MainThread) [homeassistant.components.brother] Error fetching brother data: No SNMP response received before timeout
Apr 16 16:00:48 hass hass[593]: 2020-04-16 16:00:48 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 28.083 seconds
Apr 16 16:00:48 hass hass[593]: 2020-04-16 16:00:48 WARNING (MainThread) [homeassistant.config_entries] Config entry for brother not ready yet. Retrying in 80 seconds.
Apr 16 16:00:51 hass hass[593]: 2020-04-16 16:00:51 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 27.596 seconds
Apr 16 16:00:52 hass hass[593]: 2020-04-16 16:00:52 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 27.597 seconds
Apr 16 16:00:53 hass hass[593]: 2020-04-16 16:00:53 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 27.593 seconds
Apr 16 16:00:53 hass hass[593]: 2020-04-16 16:00:53 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 27.411 seconds
Apr 16 16:00:58 hass hass[593]: 2020-04-16 16:00:58 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 27.752 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 27.459 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 27.287 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 27.107 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 26.936 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 26.749 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 26.577 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 26.428 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 26.259 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 26.084 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 25.909 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 25.813 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 25.647 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 25.400 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 25.208 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 25.031 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 24.863 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 24.691 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 24.521 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 24.351 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 24.183 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 24.013 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 23.843 seconds
Apr 16 16:00:59 hass hass[593]: 2020-04-16 16:00:59 DEBUG (MainThread) [homeassistant.components.brother] Finished fetching brother data in 23.679 seconds

This does not seem right, it seems that there’s a number of enqueued watchers, but it could be as well a number of sensors watching on a data.

However, this also leads me to the conclusion that brother sensors might enqueue a number of new queries against a coordinator, as usually they would be fast to respond, but it is not true. Now, this creates a case where, we have 20 listeners (each sensor, 20 is a some random number number, as I don’t know how many are there). Now, each of the sensors wants to update its state, so it enqueues await. Now, this times out, resulting each sensor (as each sensor did enqueue async op) to update all listeners.

@bieniu I wonder about above 😃

@SquareBeard It seems so, but someone familiar with lifecycle of devices could help out with testing it and git bisecting 😃

Happy to hear that maybe is not node red related and I’m not alone in this problem. I think I see it with node red because I have sensors and flows that react from one to the other and maybe for some reason they don’t do it like in the earlier version (maybe some sensor is out of control?).

I tested too 0.108.1 without luck, as you. I have made rollback to 0.107.7 and now all works as expected again.

If someone has some idea, I can upgrade again to 0.108.1 to test it, but until them, is impossible for me to remain in this version.