[SOLVED] VMs and High Ram Usage

Dataninja

Member
Apr 24, 2023
37
5
8
I have docker setup in a VM on a ZFS volume and the summary reports high ram usage, but free -h reports only 1gb of ram is being used. What's causing the high ram usage and is this normal?

I originally had it at 8gb and increased it to 16 thinking that 8gb wasn't enough, but it doesn't matter what the size is, it's always hovering at ~90% with/without ballooning on.

QEMU agent is installed and enabled, but has been cropped out of the image.

150.png

Ram.png
 
You have to look at the `available` column. It shows how much is actually available when needed.
The kernel can use free memory for buffers and caches, as you can see in the `buff/cache` column. It will release the memory once it is needed.
 
You have to look at the `available` column. It shows how much is actually available when needed.
The kernel can use free memory for buffers and caches, as you can see in the `buff/cache` column. It will release the memory once it is needed.
That makes sense, so I can probably decrease my ram back to 8gb. At first I thought the *arr dockers I was running was using an unusual amount of ram. Thanks!
 
"buff/cache" is still using physical RAM (so 11 of 16GB in use on the PVE host which neither can be used by the PVE host itself nor other guests), so it is not "free" but counts as "available" inside the guest, as the GuestOS could drop the cached data in case some processes need more RAM. So you want allocate the VM enough RAM that there is always enough RAM "available" but not more than needed, because you are then wasting RAM that can't be used by other guests/services.
 
  • Like
Reactions: Dataninja and mira
"buff/cache" is still using physical RAM (so 11 of 16GB in use on the PVE host which neither can be used by the PVE host itself nor other guests), so it is not "free" but counts as "available" inside the guest, as the GuestOS could drop the cached data in case some processes need more RAM. So you want allocate the VM enough RAM that there is always enough RAM "available" but not more than needed, because you are then wasting RAM that can't be used by other guests/services.
Is there a good way to determine how much ram I need? I'm new to this whole world and unsure if the dockers I use require more than 8gb.

I'm only running about 10 servarr apps (Radarr,Sonarr) and it looks like free ram is at 14gb. Does ubuntu in general not require much?
 
Monitor your free -h output under different workloads and loads. If there is always a lot of "available" RAM you allocated too much RAM. Once you see services failing because the OOM killer needed to kill some processes (monitor your syslog for "oom" messages) to free up some RAM you know that you should allocate more RAM to that VM. So give it a bit of headroom to be on the save side but not too much.
 
Monitor your free -h output under different workloads and loads. If there is always a lot of "available" RAM you allocated too much RAM. Once you see services failing because the OOM killer needed to kill some processes (monitor your syslog for "oom" messages) to free up some RAM you know that you should allocate more RAM to that VM. So give it a bit of headroom to be on the save side but not too much.
I will do that. Thanks!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!