Optimizing RAM sizing

AlpsView

Member
Apr 1, 2025
39
1
8
I'm thinking about optimizing RAM configuration/assigment in PVE over multiple VMs

The screenshot below shows the max memory consumption of a VM in months view.
The VM has been given min memory of 2 GB and max memory of 4 GB.

Obv. 4 GB is never used, peak is below 2.5 GB.
Min memory is below 1 GB at one point, base value seems to be slightly above 1.5 GB

Now with balloon enabled, what would be the best min and max configuration here?

Shall I go to 1.5 GB min and 2.5GB max?
For PVE, does it matter if max ist at 4 GB or at 2.5 GB as in both cases the effective RAM demand is lower than both values? With 4 GB I however would be on the "safe" side as there would be more "headroom".
Is it critical to select min value close to the base value? Should it be a bit more, i.e. 1.7 GB in this case?
Does it make any sense to go below 1.5 GB for min as the VM would demand more RAM anyway as it seems to need it?

With seeting min RAM do 2 GB and seeing the VM tends to only use 1.5 GB in "normal operations", does it mean PVE is reserving the 2 GB and therefor I'm blocking up to 2G - 1.5 GB = 0.5 GB for no use most of the time?

What's your experience, conclusion? What would you do?

Thx for taking your time and sharing your view and knowhow.

1764179641177.png
 
Last edited:
The max does influence the amount of memory that the VM gets (along with the Shares value): https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_ballooning .
Make sure the min value is enough for the VM to function and the VM can handle a fast memory reduction (or memory usage increase as seen from inside the VM). Proxmox does not negotiate with the VM about the memory! It just takes it away the amount it calculated as described in the manual.
 
Last edited:
The max does influence the amount of memory that the VM gets (along with the Shares value): https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_ballooning .
Make sure the min value is enough for the VM to function and the VM can handle a fast memory reduction (or memory usage increase as seen from inside the VM). Proxmox does not negotiate with the VM about the memory! It just takes it away the amount it calculated as described in the manual.

This means, min memory in my case shouldn't be lower than the "base need", so no lower than apporx 1.7 GB as if it would be lower PVE could "steal" it from the VM with unpredictable results?
 
This means, min memory in my case shouldn't be lower than the "base need", so no lower than apporx 1.7 GB as if it would be lower PVE could "steal" it from the VM with unpredictable results?
Probably. However, the 1.7G might be lower if you start the VM with less memory (i.e. a smaller max like 2G) because the software inside the VM might decide to use less memory when there is less total memory available. It's all trial and error but I think you have the right idea in general but please test this before assuming it will work well in production.
The rate that Proxmox takes away memory heavily depends on the speed that the total memory usage grows on the Proxmox host (when getting above the configured threshold).
 
  • Like
Reactions: AlpsView