Memory Usage Percentage?

louie1961

Active Member
Jan 25, 2023
161
42
28
My question is when sizing CPU and memory for a VM, how much is too much or not enough? More specifically this screenshot is from a Debian VM I am running as a docker host. It has 4 or 5 docker apps running in it. So I gave it 4 CPUs (I have plenty to spare) and 4GB of memory. For performance purposes should I be aiming for a higher memory utilization percentage or a lower one? Is there a target range that gives optimal performance? My system is not short on memory, and I am not trying to solve a specific problem. It was more a thought exercise. Overall my system shows 23% of RAM used (14 gib our of 62.59 gib)

1689775258774.png
 
Well, whatever you do, make sure that enough resources are left for the host system. Please refer to the System Requirements section in our Admin guide [1]. The host needs to have at least 1GB (minimum) or better 2GB (recommended). If you are running Ceph or have ZFS pools, you will needed additional memory (ZFS ARC).

When it comes to how much memory should be assigned to an individual VM, I would say that it really depends. Of course you at least want as much memory as needed by the guests OS and the application running in the guest. However, the guest might still profit from additional RAM, as the guest's OS will use that memory for its page cache (e.g. to cache file IO). To make things even more complicated, the IO from the VM might also hit the host's page cache (or ARC, if you are running ZFS) for IO operations. This depends on the caching settings for the guest's disk [2].

To sum up, make sure that the host always has enough memory (2 GB, + potential size of ZFS's ARC, + additional memory that Ceph might need) and then give the VMs enough memory to work with some additional headroom for their OS's caches.

[1] https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_system_requirements
[2] https://pve.proxmox.com/wiki/Performance_Tweaks
 

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!