Skip to main content Share CPU cores : r/Proxmox

Share CPU cores

Hi, im new to proxmox.

Lets say I have 4 cores, and I want to run 8 servers with 1 core assigned each. 5 or 6 servers doesnt use all the core/cpu power assigned, will any other servers be able to use this? Or will the unused resources be unused?

Discover how AI is shaping the way we work and live in Deloitte’s Tech Trends 2025.
Thumbnail image: Discover how AI is shaping the way we work and live in Deloitte’s Tech Trends 2025.
Sort by:
Best
Open comment sort options

of course you can. and of course you do share cpu power between the vms. i have easly run tens of vms over a 16 thread server. they all have very sporadic spikes in cpu and then go mostly idle.

Sure, they can use as many cores as you give them access to. If your host has 4 cores you could even give each VM 4 vCPU cores so they can fully utilize the processor. Each vCPU just becomes a thread on the host. If you notice contention becoming an issue you can scale back.

Edited

Depends, if you run traditional virtual machines,no. The idle cpus go to waste

EDIT: turns out I'm totally wrong about this, I apologize. After researching it, you can overcommit CPUs the same way you can with RAM. RHEL gives the following guidelines: don't allocate more VCPUs to a single VM than your system has physical cores and don't allocate more total VCPUs than 10x the amount of physical cores. On a quad-core CPU then you could potentially have 10 VMs with 4 VCPUs each, though they caution that if you hit 100% CPU usage the scheduler may drop requests, so that would only be a good idea if you're fairly confident that something like that wouldn't happen.

The alternative is using containers, which are very polished in proxmox. They communicate directly with the host kernel, so there's virtually no overhead and CPU power is provided dynamically

The one major caveat is that there's less isolation. A classic "privileged" container can be quite dangerous in fact, because a process with root permission inside the containers effectively has root permission around it too.

The answer there is to only run "unprivileged" containers, other than maybe for testing or whatever. It remap the UIDs so that the root user of the container is a "nobody" in the host, but it puts some restrictions on what you can do

Generally though, you want a mix of both.

Anything that isn't running a recent-ish (like no longer supported) Linux kernel can't be run in a container, so for example you can't freeNas

Also anything that's particularly vulnerable or untrustworthy can be worth running in a VM as well

The proxmox wiki has a great article on containers, check it out!

More replies