Determining Maximum Number of LXD VMs with Qemu Inside on Xeon E5-2620 CPU

Hello everyone,

I have a Xeon E5-2620 CPU with 6 cores and 12 threads. I want to run LXD VMs with Ubuntu 22.04 as many as possible, but with a caveat that each LXD VM should have another Qemu VM inside with at least 2vCPU and 2GB RAM. Currently, I am creating LXD VMs with 4vCPU and 4GB RAM, and inside the VM, I assign 2vCPU and 2GB RAM to the Qemu VM. My question is, how many LXD VMs can I launch on the server with this configuration?

I found an article suggesting a formula to calculate the number of virtual CPUs (vCPU) based on the physical CPU and the number of threads and cores. According to this formula: (Threads x Cores) x Physical CPU = Number of vCPU. In my case, (12 x 6) x 1 = 72. Does this mean that I can have around 72/4 LXD VMs?

I would appreciate any insights or suggestions on how to optimize the configuration for maximum performance. Thank you!

The article I referenced is: