• Re: Small server hanging after some days - top, load avg and Mem buff/c

    From Dan Ritter@21:1/5 to B.M. on Mon Oct 28 16:10:01 2024
    B.M. wrote:
    Thanks a lot for your inputs. In the meantime I disabled zram and added a 2 GiB swapfile.

    What I don't understand: how can the system have not enough memory problems, while it's showing ~ 2 GiB cached/buffer? I'd expect it to free some of that and be fine again... 2 GiB is about 50% of the physical RAM of 4 GiB?

    That 2GB is being used by zram as swap and cannot be freed.

    You probably managed to increase your usable memory by 10-20%
    with zram -- at the cost of constantly swapping.

    (That's my hypothesis, anyway.)

    Let us know what happens in a day or two.

    -dsr-

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Ritter@21:1/5 to B.M. on Mon Oct 28 15:40:01 2024
    B.M. wrote:
    Hi,

    I have a small server (Raspberry Pi 4 in fact) and since a couple of weeks it repeatedly hangs after some days until I reboot it (after months of uptime without any problem - but I changed a few things in the meantime, so maybe load is now higher than before).

    At least after installing watchdog it reboots now automatically.

    Here some top output just before reboot:

    load avg 20 18 12 (so: much higher than normal, e.g. 1.1 1.2 1.5 or so)
    MiB Mem: 3835 total, 618 free, 1194 used, 2264 buff/cache
    MiB Swap: 1024 total, 600 free, 430 used, 2640 avail

    Processes with highest CPU usage:
    kswapd0 with 80%

    Swapping once is fine. Swapping continuously is bad.

    java (openhab) 41%
    pg_dump 18%

    pg_dump should not be running continuously; if it is running too
    long, you need a better way of backing up PG. Replication to
    another server is usually very efficient.

    Processes with highest Mem usage:
    java (i.e. openhab) with 626678 virt, 22%
    postgres 338824 virt
    postgre 338800 virt

    From my understanding, there is enough memory available, even swap usage wouldn't be necessary, since buff/cache is about 50% of physical memory. Is this correct? But than: why is it going to hang afterwards, or why this extreme load?

    The only swap device available is zram, no swap partition, no swap file. The system runs on btrfs

    Ooch. Your system is likely thrashing between using RAM for the
    applications (java, PG, pg-dump) and using RAM to swap out from
    RAM to compressed RAM (this does not buy you as much as you
    think).

    The problem, then, is that you don't have enough RAM and you don't
    have enough I/O speed to solve the RAM issue temporarily, so it
    becomes permanent.

    Try disabling swap entirely.

    If that doesn't work, you need a machine with more RAM, or you
    need to be using less RAM.

    -dsr-

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B.M.@21:1/5 to Dan Ritter on Mon Oct 28 15:35:45 2024
    Copy: debian-user@lists.debian.org

    On Montag, 28. Oktober 2024 15:21:02 CET Dan Ritter wrote:
    B.M. wrote:
    Hi,

    I have a small server (Raspberry Pi 4 in fact) and since a couple of weeks it repeatedly hangs after some days until I reboot it (after months of uptime without any problem - but I changed a few things in the meantime,
    so maybe load is now higher than before).

    At least after installing watchdog it reboots now automatically.

    Here some top output just before reboot:

    load avg 20 18 12 (so: much higher than normal, e.g. 1.1 1.2 1.5 or so)
    MiB Mem: 3835 total, 618 free, 1194 used, 2264 buff/cache
    MiB Swap: 1024 total, 600 free, 430 used, 2640 avail

    Processes with highest CPU usage:
    kswapd0 with 80%

    Swapping once is fine. Swapping continuously is bad.

    java (openhab) 41%
    pg_dump 18%

    pg_dump should not be running continuously; if it is running too
    long, you need a better way of backing up PG. Replication to
    another server is usually very efficient.

    Processes with highest Mem usage:
    java (i.e. openhab) with 626678 virt, 22%
    postgres 338824 virt
    postgre 338800 virt

    From my understanding, there is enough memory available, even swap usage wouldn't be necessary, since buff/cache is about 50% of physical memory.
    Is
    this correct? But than: why is it going to hang afterwards, or why this extreme load?

    The only swap device available is zram, no swap partition, no swap file. The system runs on btrfs

    Ooch. Your system is likely thrashing between using RAM for the
    applications (java, PG, pg-dump) and using RAM to swap out from
    RAM to compressed RAM (this does not buy you as much as you
    think).

    The problem, then, is that you don't have enough RAM and you don't
    have enough I/O speed to solve the RAM issue temporarily, so it
    becomes permanent.

    Try disabling swap entirely.

    If that doesn't work, you need a machine with more RAM, or you
    need to be using less RAM.

    -dsr-

    Thanks a lot for your inputs. In the meantime I disabled zram and added a 2
    GiB swapfile.

    What I don't understand: how can the system have not enough memory problems, while it's showing ~ 2 GiB cached/buffer? I'd expect it to free some of that and be fine again... 2 GiB is about 50% of the physical RAM of 4 GiB?

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCgAdFiEEikKioFYA3Uj89MUOV4VoAirdxWUFAmcfoUEACgkQV4VoAird xWV9Kgf9FKNzwhUPuNgLzSVUI8rTS6xWfWR4ZhjOHb1sEKnycQ3fOvWpswQ6VoR6 9rudL+H5KpfKiJ5cWkNMeONTvWWOgPHPrE9JU4jVKGlWN1zLcrVuomyHtlI70NF8 MeA65caoATkR0nMwLPDe+XFvnzbYfW3IczI6tjMV0O0OxX133PgVdnU3kvCV8Ezx 25dKxx6X7lhztXZvDBRkjWwB6+qYhWscahj0QmIhg8zny5kVwbbXAkX82iim87dW K3vWOMdcjzPRZx5uww958W6bSLdqkptQiaJS1lrwYupgN7cOO0XFua5uWZWyZc8c /3ZZmpBS9PuGsIBs3kah+6KNjTh4ng==
    =k5ak
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)