Homeassistant - CPU Usage spikes in Sawtooth pattern

Hi All!

I have been using HomeAssistant for almost a month now and when looking at the power consumption of my server i noticed a “strange” periodic pattern. After further investigation i found that it relates directly to the homeassistant CPU usage.

The CPU Usage seems to be very high for a minute, than high for another and then low for the next.

I am using the virtual machine image with a bunch of integrations - MQTT, HomeMatic, Web Scrape Sensors, Unifi, Tradfri, Mobile Apps …

I checked top and see that the main python3 process causes the load

Could you point me to any direction how to debug this further and maybe identify which module is causing the CPU utilization?

Thanks + best regards


Comment out all your automations and see it it goes away. If not, you should also check scripts, sensors, binary sensors and custom components. I’d start with custom components.

But say it was in your automations;
Comment out half your automations.
Check CPU use.
Once you find which half it is in, divide that half in half and reload… repeat halving and checking until you find the culprit.

Thanks for the hint - i have already tried by getting rid of all automations, scrapes, homematic, mqtt - essentially everything that is done via config files: still same behavior.

My config file is now “default_config:” - nothing more

The problem i am facing now, is that the rest of the configuration is done via the ui - i cannot really comment that stuff out without deleting it.

Is there any other way how to dig into this?

best regards


The culprit was the IKEA Tradfri component. The gateway had died silently and the integration did not fail exactly in a glamorous way as each connection retry took about 1,5 minutes of a full single core in CPU power.

Issue solved however :slight_smile:

Thanks for the help


1 Like

Once had the same problem. The Tradfri gateway is unreliable because of connection etc… Remove it and replace it with Zigbee2MQTT, much better and never have problems again :smiley:

Why would you remove something that is supported by HA?
And can you really use Ikea Trådfri as a controller in zigbee2mqtt?

Wouldn’t it be better to submit a bug report?

Just because it is supported does not mean it works as well as alternatives.

Sure, you can throw more money at the issue by purchasing another controller.
But it is better if the hardware you already own works as intended.

That is why you should submit a bug report.

Sure if you’re prepared to wait up to 2 years for it to be fixed. e.g. The first report for the Pi gpio binary sensor not working was 2 years ago. Looks like there might be a fix in the next release.