How to found out what is eating my CPU?

Hello,
I am running hass.io on NUC (no virtual env, no Ubuntu + docker, just straight hass.io).
My problem is that system monitor shows high CPU load 50% to 70% but top command in hassio cli shows max. 11%. CPU load mus tbe high because fan is spinning almost al the time and usually it’s hardly on. There is nothing unusual in a logs as far as I can tell.

How to found out what is eating my CPU?

Thank you.

High loads are often caused by failing hardware as the cpu keeps getting pegged retrying to access a dying drive or something. Or simply an IO bound process may do it.

Besides, top shows more than just the usage of home assistant, what else is it showing you?

Hello,
SSD and RAM should be fine otherwise hassio would’t be working I guess, Deconz USB stick is working, Z-wave USB stick as well I guess (I can contrtol z-wave and zigbee devices). And that’s all hardware I have connected.

This is top output:

Any sugegestions?
Thank you.

What add-ons are you running? Have you thought about stopping them one at a time and checking the impact on your system?

Digging a little further, there is a stats option for hassio that lets you look at a given add-on. It looks like you need to check each add-on individually.

core-ssh:~# hassio addons stats --help
Usage:
hassio-cli addons stats [slug] [flags]

hassio addons stats core_samba

blk_read: 4.0132608e+07
blk_write: 1.810432e+06
cpu_percent: 0.04185275510204081
memory_limit: 9.71137024e+08
memory_usage: 2.7865088e+07
network_rx: 0
network_tx: 0

In top you can press m to sort by memory use or c to sort by cpu usage.

@bigmike… did you ever figure this out? I’m running HassOS as a VM (virtualbox) allocated 1 core of my host server–and that core is pegged at 100% all the time; yet like you, top doesn’t seem to reveal anything using much CPU (i.e. all 0%)–even whn ordered by CPU (as @nickrout suggested).

Hello,
I installed Glances addon. It will show what’s going on with your system. It was some other addon in my case.

Good luck.

4 Likes

Thanks… that’s what i just did… it was a python3 process. I seems to have fixed this my removing default_config then selectively re-adding the content (I suspenct it was zeroconf or ssdp causing he issue).

I found that MUCH of the cpu usage is due to the builtin sqllite recorder. I was able to eliminate quite a bit of cpu drain (approx. 75-80%) by simply using a MySql server running on another computer.