PfSense uses 100% of swap but only 10% of memory.
-
Hey guys,
I don’t really know why, but according to
htop
my PfSense uses 1024 MB / 1024 MB SWAP but only an average of about 878 MB / 10.9 GB of RAM (see attached picture).
I set the RAM that high because the Web-GUI tells me, even with 11GB RAM configured, I am still getting to 93-99% Memory usage, buthtop
seems to disagree (?).
The problem is that the interfaces for Suricata are constantly crashing and also the DNS Resolver seems unstable to me (sometimes takes ages to resolve a domain when connected to the FW, while https://1.1.1.1 loads instantly).Does someone know how to fix this problem? And who is „right“: PfSense Web GUI or
htop
?TL;DR: PfSense tells me memory is nearly full and SWAP usage zero, while htop tells me the opposite.
-
@ma0f97
Check out with top, what's eating up the whole memory. -
htop looks likes it's displaying an inverted value there because the dashboard shows 98% RAM used and 0% SWAP which is a far more feasible combination.
Steve
-
@stephenw10 How could it display the opposite value? Isn‘t that strange?
top‘s output looks strange, maybe I interpret it wrong but why does it say 359M Active and 934M free? I have 11 Gigs RAM configured, what’s going on here? Is the RAM not recognized? I am really confused to be honest…
-
@ma0f97
Order the output by memory usage:top -o res
-
@ma0f97 said in PfSense uses 100% of swap but only 10% of memory.:
How could it display the opposite value? Isn‘t that strange?
It is strange, yes. I was assuming those were taken at approximately the same time. If they were not it's possible something used all the RAM and most of the swap and then freed the RAM when it was done.
1G SWAP on top of 10G RAM doesn't make much sense there to me beyond providing somewhere to dump the crash reports.
Also, generally speaking, if you start using SWAP at all you are usually doing something wrong.
Steve
-
Ok I managed to solve the issue. The problem was that in the VM Hypervisor (Proxmox) I accidentally enabled „ballooning“ memory (which means it will remove memory on the fly if it detects that the VM is not using it).
I disabled it and now it all works like a charm. I guess the GUI (and myself) was confused that the RAM was removed from the VM while running, therefore showing memory usage „of 11GB“ while in reality it only had way less memory at this point.