openenergymonitor / EmonScripts

Emoncms Stack Installation and Update scripts
16 stars 30 forks source link

PHP memory leak or something #188

Closed lamixer closed 11 months ago

lamixer commented 11 months ago

Hello:

I installed emonhub and emoncms using the scripts found here.

After having everything running smoothly and reliably for a few months, I began noticing I was no longer getting data into Home Assistant from my linux container running emonhub and emoncms. I discovered that the container machine was using all resources and froze.

I gave it more memory and started it up again and watched it. A PHP process running as root (not under user pi) was swelling to use all available memory.

pi@emon-cms:~$ php -v
PHP 8.1.2-1ubuntu2.14 (cli) (built: Aug 18 2023 11:41:11) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.14, Copyright (c), by Zend Technologies
top - 08:39:52 up 1 day, 23:22,  1 user,  load average: 0.08, 0.03, 0.00
Tasks:  35 total,   1 running,  34 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  3.2 sy,  0.0 ni, 96.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :   4096.0 total,     38.0 free,   4057.6 used,      0.4 buff/cache
MiB Swap:   2048.0 total,   1188.9 free,    859.1 used.     38.4 avail Mem

428 root 20 0 4842580 3.8g 13312 S 0.0 96.1 6:09.83 php

The OS is up-to-date and then today I ran the updater in EmonScripts which didn't seem to change anything.

Known php issue? Something with emonhub?

lamixer commented 11 months ago

Hi... I posted in the Ubuntu PHP forums and it was suggested this could be an issue with 6.5 linux kernel Proxmox just updated to. Likely not an issue of your software stack. Thanks.