ElectricBrainUK / UnraidAPI

A WIP open source Node JS API for controlling UNraid
GNU General Public License v3.0
125 stars 13 forks source link

Unraid container maxing out CPU cores / threads #33

Closed squireblackdens closed 3 years ago

squireblackdens commented 3 years ago

Hi there.

Thanks for this - looks v promising!

Just installed this on my Unraid server and connected to HA (which runs on a VM also on that Unraid server).

All connects fine, MQTT broker in HA connects and entities appear in HA.

However, aprox 30 sec after I start your API container in Unraid, my CPU / CORES go from around 25%-35% (their base level with what I run on unraid) to 100% and stay there. The VMS / dockers slow to a crawl.

Here is log from your API container after starting:

unraidapi@0.5.0 start cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js WARN mode option is deprecated. You can safely remove it from nuxt.config READY Server listening on http://0.0.0.0:80 Connected to mqtt broker Connected to mqtt broker Received MQTT Topic: homeassistant/hal/daapd/dockerState and Message: started assigning ID: MQTT-R-knafunrt MQTT-R-knafunrt succeeded Received MQTT Topic: homeassistant/hal/daapd/dockerState and Message: stopped assigning ID: MQTT-R-knafuthk Received MQTT Topic: homeassistant/hal/daapd/dockerState and Message: started assigning ID: MQTT-R-knafuxsj MQTT-R-knafuxsj succeeded MQTT-R-knafuthk succeeded npm notice npm notice New minor version of npm available! 7.5.1 -> 7.9.0 npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.9.0 npm notice Run npm install -g npm@7.9.0 to update! npm notice npm ERR! path /app npm ERR! command failed npm ERR! signal SIGTERM npm ERR! command sh -c cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-04-09T15_06_27_910Z-debug.log unraidapi@0.5.0 start cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js WARN mode option is deprecated. You can safely remove it from nuxt.config READY Server listening on http://0.0.0.0:80 Connected to mqtt broker npm ERR! path /app npm ERR! command failed npm ERR! signal SIGTERM npm ERR! command sh -c cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-04-09T15_14_49_813Z-debug.log unraidapi@0.5.0 start cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js WARN mode option is deprecated. You can safely remove it from nuxt.config READY Server listening on http://0.0.0.0:80 Connected to mqtt broker Connected to mqtt broker

squireblackdens commented 3 years ago

Sorry, forgot to say - running Unraid 6.9.2

squireblackdens commented 3 years ago

OK - found the issue. Have 'Tips & Tweaks' installed and on 6.9 if you have 'CPU scaling govenor' set to power save, it causes this problem - https://forums.unraid.net/bug-reports/prereleases/690-rc1-rc2-cpu-usage-stuck-at-100-2-corethread-r1172/ . Set it to 'on demands and now all is well! Thanks.

willnnotdan commented 3 years ago

Thanks for letting me know!