tomaae / homeassistant-truenas

TrueNAS integration for Home Assistant
Apache License 2.0
194 stars 19 forks source link

CPU usage above 100% [Bug] #78

Closed julienlarivee closed 7 months ago

julienlarivee commented 1 year ago

Describe the issue

The CPU usage is above 100% in Home Assistant but not on the TrueNAS Dashboard

How to reproduce the issue

I am currently running a linux vm inside truenas wich is transcoding video files. The cpu is quite high. Around 75-90%

Expected behavior

Show the cpu usage like the one in the dashboard

Screenshots

image

image

Software versions

Diagnostics data

config_entry-truenas-7a5b83130ee9cf754ba9c684b45ec46d.json.txt

Traceback/Error logs

Additional context

tomaae commented 1 year ago

seems like your nas is reporting wrong data. can you debug it?

julienlarivee commented 1 year ago

Hope there is all you need in it.

tomaae commented 1 year ago

So truenas is reporting something really weird here. Idle 100% system 96%?

"legend": [
      "interrupt",
      "system",
      "user",
      "nice",
      "idle"
    ],
    "aggregations": {
      "min": [
        0.044981283522,
        96.94838281,
        97.943732712,
        97.943732712,
        100.0
      ],
      "mean": [
        0.070168899641,
        97.534423475,
        98.48254716728572,
        98.48442206357143,
        100.0
      ],
      "max": [
        0.10591442289,
        98.535371417,
        99.400916464,
        99.400916464,
        100.0
      ]

Try running mpstat or iostat to see if its problem with API or OS customization.

julienlarivee commented 1 year ago

I got this while on heavy load: image

tomaae commented 1 year ago

ok, so its problem with API itself. Nothing I can do there unfortunately.

julienlarivee commented 1 year ago

No problem. Thanks

tomaae commented 1 year ago

I plan to look into it further, but no promisses at all. I may open issue with IX, but they are super slow to fix API things.

rlewis187 commented 1 year ago

Doesn't TrueNAS report CPU usage as 100% x Number of cores?

https://www.truenas.com/community/threads/what-does-cpu-usage-mean-mine-is-often-100.61708/

tomaae commented 1 year ago

Thats how linux reports it, yes. But core and scale reports cpu usage inconsistently via API. Core always reports 100% as all cores. Scale did that too durring my development, but it seems to be different now. Possibly a bug in API.

tomaae commented 7 months ago

seems to be fixed in API