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)
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.