Incusd.log high CPU usage

Incus LTS 6.0.6

Htop showed a very high permanent CPU usage (99% of at least 1 Core) for incusd.log.
By removing –logfile /var/log/incus/incusd.logfrom /usr/lib/systemd/system/incus.serviceand systemctl daemon-reload could save 30-40Wh power consumption, 29KW/month.

That’s extremely unlikely to be the cause of the issue as the internal logging logic is identical whether -logfile is specified or not. That is unless there is something that would prevent Incus from writing to the log file such as /var/log being full.

Does putting -logfile immediately cause that CPU usage to come back for you?

Have put the logging again in place.
No significant cpu usage yet. Will monitor it.

Previously I had to put a power cap on server, though it made it too slow overall, after lifting the cap, it went up from >120W to >170W.
Disable logging and it got calm again:

Most likely what fixed it was restarting Incus after the change more than the change itself doing something.

If it goes crazy again, it would be useful to do:

incus config set core.debug_address 127.0.0.1:8444
curl http://127.0.0.1:8444/debug/pprof/goroutine?debug=2

This will provide a full dump of all the goroutines running in Incus, typically making it pretty easy to spot what’s wrong.