Running multiple VMs with Core i3?

3

2

I have a desktop with Core i3 + 8GB.

It looks like I need to assign one of my CPU cores to a VM. That means I can only run one VM at a time?

Does VM application actually uses a core for each VM images? Or Do they depend on memory?

user45326

Posted 2012-07-10T00:51:58.760

Reputation: 1 623

2You need to tell it how many CPUs to virtualize (depending on VM stack), but that's not the same as giving up a physical CPU in it's entirety. What makes you think you need to assign a CPU? What VM software are you using? What have you tried already? – Ƭᴇcʜιᴇ007 – 2012-07-10T00:56:13.370

Answers

7

The core you assign to the VM is a virtual core. You have an effectively unlimited supply of virtual cores.

David Schwartz

Posted 2012-07-10T00:51:58.760

Reputation: 58 310

VMware official training calls Virtual CPUs an infinite resource, and Virtual Memory a finite resource. Yes, performance may take a hit if you over-provision your vCPU, but it does not necessarily do so. vCPU commands are queued and then handed over to the host CPU for processing in turn. If the queue gets long, you get delay, but that is why intelligent configuration of a VM environment is good and you can place multiple systems with different load times and load types (backup machines that run at night co-hosted with processing machines that run during the day, for instance) to optimize. – music2myear – 2017-01-23T18:48:38.297

1While factual, if the number of virtual cores used exceeds the number of physical cores, there is a probability of overall performance taking a hit. – killermist – 2012-07-10T04:39:21.317

@killermist: that depends entirely on whether or not the virtual cores are actually "in use". 10 VMs idling on a 4-core machine will not significantly slow down the single VM doing actual work (unless, of course memory is restricted as well). – Joachim Sauer – 2012-07-10T06:12:47.717

@JoachimSauer True. When you get into virtual ... anything (except memory), things get fuzzy. – killermist – 2012-07-10T06:18:58.353

6

Though the other answers are correct, there are a few things that you want to be aware of.

  1. Do not exceed the number of actual threads that you have available on the server within a single VM. For example, if your Core i3 has 4 threads (i.e. Dual Core with HTT) then do not create a VM with 8 threads. They will more often than not freak out and actually run extremely slow.

  2. Though you can allocate more RAM to your VMs than what your server actually has, beware of actual RAM used and try not to exceed your bare metal max. You'll start using SWAP and that is just hella slow. You're better off lowering the RAM on each VM if the amount used is starting to use SWAP (Virtual Memory).

  3. Just because your CPU idles at 25-50% doesn't mean that you have room for 2-4x the number of VMs. You do not want to run your CPU at idle (or minimal processes) very high. There is always a natural amount of CPU usage and overtime you will see some statistical data on your servers to know peak times and how much more you can realistically put on the server.

  4. Typically with VMs and Clouds, the slowest part of the server is the hard drives. It's best to match the number of VMs that you're planning on running with a SAN/HDDs that can support them. My Raid5 reliably pushes 300MBps.

My private cloud has about 20 VMs running on it at any given time. A few of the VMs include Proxy Server, VPN Server, WHS, Database Server, 5 Ruby on Rails Applications, Astrix Phone Server, 2 WordPress Servers, Virtual Host Web Server (10 websites).

It's a Intel Xeon E3-1270, 32GB RAM, 8x1TB 7200 RPM RAID5, and 50Mbps connection. For the most part, it idles around 5-10% CPU usage. It peaks around 75% CPU usage. I'm using Proxmox as my virtualization solution and love it. I've been using it for a few years now.

kobaltz

Posted 2012-07-10T00:51:58.760

Reputation: 14 361

2

A CPU in a virtual machine does not map directly to a physical CPU [core]. You can safely run dozens of VM, each with multiple virtual CPUs even if you only have a single 'real' CPU core.

Hennes

Posted 2012-07-10T00:51:58.760

Reputation: 60 739

2

I've quite comfortably run 3-4 VMs at once on a c2d. There's a few concepts here. Firstly that while a core can run one thread at a time (not counting hyperthreading and such), it can switch between threads, Two cores is better since they don't need to switch a core between threads as often, but it isn't a showstopper.

Its no different from running multiple copies of a program (Chrome for example runs a process per tab), or a single multithreaded piece of software.

Your ram and processor usage is far more critical than coredness, and even dedicated VM hosts have far less cores than VMs running.

I'd also note that some vm host software lets you run more virtual cores than physical ones, so its quite certain that you don't need a core per vm.

Journeyman Geek

Posted 2012-07-10T00:51:58.760

Reputation: 119 122