High RAM usage

Started by Mayo132, October 13, 2023, 06:51:09 AM

Previous topic - Next topic
Hi everyone,

please let ma ask a question about the RAM usage.

AFter some time the RAM Usage increases to the max available ram. But i do not know why.

After looking at "System -> Diagnostics -> Activity" the are many Processes with 60M Ram size. It is called " /usr/local/bin/php /usr/local/etc/rc.newwanipv6 ppoe1 force (<php>)"

After rebooting the system, everything is working fine.

Someone got a similar problem ?


Thanks a lot

Mario

October 13, 2023, 06:55:31 AM #1 Last Edit: October 13, 2023, 06:57:58 AM by Monviech
When you use ZFS as Filesystem it caches some files into the RAM. (ARC Cache)

If the file system is ufs maybe there are processes spawned that don't terminate completely (like the pppoe one you mentioned). If that's the case maybe it needs further investigation.
Hardware:
DEC740

Yes,  ZFS is used by this system.

> Is there any possibility to clear the cache after some time?

I wouldn't mess with the caching, the developers of ZFS were probably smarter than us. :)
Hardware:
DEC740

Ok, thanks.

Some additonal info. A reboot is not working at the moment. Memory Usage still says 99% ram and 99% swap usage.

October 13, 2023, 07:03:41 AM #5 Last Edit: October 13, 2023, 07:05:17 AM by Monviech
How much RAM does your system have?

The swap file being heavily used seems odd to me.
Hardware:
DEC740

It got 8 GB and the Swap size is also 8 GB.

But there are not many Plugins installed. I've only installed Monit

HI,

at the moment the Swap usage is freed up.  (at this time only 87%)

The only thing i changed is, to disable all IPv6 options on the Interfaces.


Maybe you found a process that spawns a huge number of child processes that don't terminate when thry're finished. You could check it with:
ps -axH

I cant help here anymore though since I don't know that much regarding system processes.
Hardware:
DEC740

Hey,

i hope the atteched file will help you.

Thanks

October 13, 2023, 08:04:51 AM #10 Last Edit: October 13, 2023, 08:18:29 AM by Monviech
Yeah I think it looks like a php script that doesn't terminate after it's done. (You were actually spot on in your first post :) )


52650 root 20 0 60M 5M CPU3 3 0:00 0.12% /usr/local/bin/php /usr/local/etc/rc.newwanipv6 pppoe1 force


This here spawns child processes till the RAM and SWAP is full.
Maybe a developer will read this and answer.

If you can replicate it easily you could also open an issue here with your full setup and what you're doing to get this issue:
https://github.com/opnsense/core/issues
Hardware:
DEC740

Quote from: Monviech on October 13, 2023, 08:04:51 AM

If you can replicate it easily you could also open an issue here with your full setup and what you're doing to get this issue:
https://github.com/opnsense/core/issues

Thanks for your support. But I do not know when the issue appears. Sometimes it works fine for many days. And sometimes not.

But i will check if the failure also occurs when IPv6 is disabled.

At the moment the memory usage is 980/8071 MB of RAM and the ARC size is 260MB

Mario

I wouldn't worry too much unless processes start being killed.
The allocation of most of the memory is normal in freebsd with zfs, and is always good to have some swap.
I imagine it you use top or htop to have a live look at what is happening, you'd see the active amount of memory is low, even some swap has been used and eventually goes down.

You can try turning off all of your plugins and keeping an eye on the memory usage.  That will help you tell if it's a core issue or not.  Then slowly add them back one at a time and see what happens.

Another thing to watch is what your users are doing on the network.  I saw a place chasing their tails trying to figure out why a server kept randomly going OOM until the realized it happened when a user attempted to upload a large file for processing.  It could be that you're having something similar happen with torrents, game updates, etc.

True but to remain on the OP and avoid chasing ghosts unnecessarily: "AFter some time the RAM Usage increases to the max available ram. But i do not know why."
This is freebsd on zfs. Usage of most of RAM is normal.