My CPU load (raspi4, 4GB) is over 100%, how to trace?

I run my HA instance on docker on a raspi4 with 4GB RAM, I noticed that my HA is really slow lately, but nothing really changed. I’d like to track down what is causing the high CPU usage, on portainer you can see on the graph below that the usage reduces to about 100% after restarting HA, but before that it was like 300%.

I had “preload stream” enabled on four cameras. I disabled this. It didn’t make a lot of difference. I ran the top command on the host, and also installed htop and ran that inside the container, it shows:

host: 805 root 20 0 488252 343252 38624 S 85.5 8.7 17:16.72 python3


I installed “profiler” integration on HA as a starting point but don’t know exactly how to use it.