Hello dear Home Assistant community!
I stumbled to a behavior I cannot really dig down what the cause of this is. I have Home Assistant running in WSL2 on my Windows machine. For the first weeks it run just fine with basically 0% CPU usage. I added some automations and integrations here and there and it was still fine. But suddenly I have weird CPU spikes and they even get higher over time.
At 19:00 is where I restarted Home Assistant. As you can see, the CPU usage grew over time.
I can already tell, this is coming from Home Assistant because when it is not running, the CPU is basically doing nothing. I tried to narrow it down to the source by disabling all automations and even disabling integrations. But they had no effect. Not even upgrading Home Assistant to the latest version using Python 3.9.
I even used py-spy to inspect it and I noticed that http/client.py is using most of the CPU time. But why? Any ideas?
I am even to the point considering wiping all data of Home Assistant and starting everything from scratch. But would be cool if somebody has an idea what’s the cause of this before I do that
Also this what the log is outputting repetitively:
2022-03-22 12:27:31 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/homeassistant/components/dhcp/__init__.py", line 287, in async_discover
for host in await self._discover_hosts.async_discover():
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/aiodiscover/discovery.py", line 153, in async_discover
neighbours = await sys_network_data.async_get_neighbors(hostnames.keys())
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/aiodiscover/network.py", line 173, in async_get_neighbors
neighbors = await self._async_get_neighbors()
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/aiodiscover/network.py", line 186, in _async_get_neighbors
return await self._async_get_neighbors_ip_route()
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/aiodiscover/network.py", line 229, in _async_get_neighbors_ip_route
for neighbour in await loop.run_in_executor(None, self.ip_route.get_neighbours):
File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/pr2modules/iproute/linux.py", line 319, in get_neighbours
return self.neigh('dump', family=family, match=match or kwarg)
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/pr2modules/iproute/linux.py", line 1072, in neigh
ret = self.nlm_request(msg, msg_type=command, msg_flags=flags)
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/pr2modules/netlink/nlsocket.py", line 403, in nlm_request
return tuple(self._genlm_request(*argv, **kwarg))
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/pr2modules/netlink/nlsocket.py", line 907, in nlm_request
self.put(msg, msg_type, msg_flags, msg_seq=msg_seq)
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/pr2modules/netlink/nlsocket.py", line 646, in put
self.sendto_gate(msg, addr)
File "/mnt/c/Users/DeDelner/homeassistant/lib/python3.9/site-packages/pr2modules/netlink/rtnl/iprsocket.py", line 87, in _gate_linux
return self._sendto(msg.data, addr)
OSError: [Errno 95] Operation not supported