OPNsense memory usage

Started by MarekWojtaszek, May 11, 2023, 06:20:44 PM

Previous topic - Next topic
I recently expanded memory for my OPNsense virtual machine hosted on Proxmox, from 2GB to 8GB. Here is what I can see in the system info:



Just about 6% of memory utilized.

And here is what Proxmox shows for the same virtual machine



Over 7GB of memory is being used!

Which one is telling me truth? Funny this is that before expanding memory the system showed less than half memory used in Proxmox for that VM.

Marek

May 11, 2023, 07:05:21 PM #1 Last Edit: May 11, 2023, 07:10:52 PM by netnut
QuoteOver 7GB of memory is being used!

Your assigned more memory to the VM and it's actually being used, how cool is that ;-)

QuoteWhich one is telling me truth?

The first one...

Your view from Proxmox is just the used memory from the VM perspective. Memory management in a modern OS like FreeBSD is quite complex, it's not just some Physical vs. Used mem. If you really like to dive into the gory details here's a nice start:

systat -vmstat

https://wiki.freebsd.org/Memory

https://papers.freebsd.org/2017/bsdtw/johnston-memory_management_in_freebsd_12.0/




Do you have the QEMU Guest Agent installed? It's available as a plugin. That should enable Proxmox to communicate with the guest, iirc it will also help display correct memory usage stats.

May 11, 2023, 08:56:09 PM #3 Last Edit: May 11, 2023, 09:01:06 PM by MarekWojtaszek
Quote from: netnut on May 11, 2023, 07:05:21 PM

systat -vmstat

https://wiki.freebsd.org/Memory

https://papers.freebsd.org/2017/bsdtw/johnston-memory_management_in_freebsd_12.0/
Frankly, this is my first two weeks of my OPNsense journey, same for Proxmox, so I am still on the learning curve ;)

The command confirmed what I see from the GUI.

Thanks buddy, that was helpful.

Quote from: marcquark on May 11, 2023, 07:30:03 PM
Do you have the QEMU Guest Agent installed? It's available as a plugin. That should enable Proxmox to communicate with the guest, iirc it will also help display correct memory usage stats.
Not really. I installed the agent on other Linux VMs but have not tried with OPNsense yet.

To my knowledge this is an unresolved issue. Plenty asked here and in virtualization forums like https://forum.proxmox.com/threads/freebsd-guest-wrong-ram-usage.87693/#post-538559
Short of it is that even if you install and run the agent, the memory usage metrics won't match.
Mine never have and I have learned to live with only trusting the ones in the VM. Note this is not an OPN flaw.
It is better to have the agent running than not though.