Heimdall
Heimdall copied to clipboard
Memory usage leak? Systematic CPU usage spikes
I am noticing my Heimdall in docker on ubuntu server 20.04 is not only steadily increasing in ram usage up to around 500MB, as well as a 3-5 second process running for php-fpm. I disabled all the external API calls for my added panel icons. Still seeing the slow rise in ram usage as well as that php-fpm process.
Same for me, jumping from 0,2% to 10%-18% of 1 CPU. top says 3 times php-fpm7 using most CPU. All enhanced features allready disabled.
Heimdall uses more RAM (~120mb) than some of my more complex docker containers like influxdb and consumes more than most of my other containers added together. Considering how simple Heimdall is (it's a bunch of HTML with occasional polling of REST endpoints for the interactive type cards) ...it's a little bit absurd how much RAM it needs!
@ChrisThePCGeek @timdonovanuk On memory usage: Heimdall is running on the Laravel PHP Framework. With default settings php-fpm uses around 60-100 MB of ram even when it is not serving anything at all. Nginx another few Megabytes...
If you want to optimize the RAM usage to be even lower, you could adjust the php fpm config. In case of the Heimdall docker image it is located in: config/php/www2.conf
and play with this settings, for example:
[www]
pm = ondemand
pm.max_children = 1
pm.process_idle_timeout = 10s
pm.max_requests = 100
With the above config I could get the php fpm process to fit in 50mb of ram. Obviously the above settings will have an impact on the response time / availability of the service. If you are only using it as a single user on your local network, you should have no problems with the above settings.
The CPU spike issue should be resolved with v2.5.4. Closing
@keriati thanks a lot for sharing the php pool config above. Memory usage came down from ~200M to <50M. Is it possible to include that in the docker image? Thanks!