4

I have SQL Server 2008 Express running on Hyper-V based virtual machine with two vCPU-s. I've just been reading up on SQL Server 2012 Express and noticed that it's CPU is "Limited to lesser of 1 Socket or 4 cores" (http://msdn.microsoft.com/en-us/library/cc645993(v=SQL.110).aspx)

My question is how do the SQL Server 2012 limits on CPUs/Cores translate into vCPU-s? Are they "processors" or are they "cores"?

EDIT:

I've just found this: Are vCPU the same as 1 Socket, or a single Core?

Basically the solution is download CPU-Z and check, which I did. On my 2 x vCPU VPS the CPUZ is showing 1 core 2 thread so it sounds like my SQL Express should fly on both vCPUs. However when I go into processor affinity configuration it shows 2 processors there making it appear that it is using just one of the vCPUs allocated to my VPS. I am utterly confused :/

1
  • 1
    Just as a side not, ESXi 5 and later let you choose to present vCPUs as either cores or sockets. This really helps for licensing purposes, and performance is largely the same.
    – MDMarra
    Aug 30, 2012 at 17:56

2 Answers 2

4

Each vCPU counts as a single CPU from within the guest OS, which means that guest OSes and the applications inside them, each physical core is a single CPU.

Virtualization abstracts the physical hardware, so all the guest OS and any application inside it can see are the values the hypervisor passes to them. In your case, the hypervisor tells the OS you have two CPUs because that's how you set it up - to have two virtual CPUs. So when SQL goes to look at how many CPUs you have, SQL sees the two [virtual] CPUs you assigned, so SQL Express limits itself to using one.

I guess I should add this: A quick and dirty on how to configure vCPUs in Hyper-V. If you want SQL Express to use more CPU resources, put in one vCPU and map it to more physical processors and/or a higher resource limit. That will allow SQL Express to use as much of the CPU resources the host can allocated to it, without bumping into the CPU licensing limitation of SQL Express.

Oh, but don't do this on your existing OS, as changing the number of processors between single and multiple CPUs in a Windows OS leads to trouble - it makes the OS unstable. Create a new VM, with a new OS install, and this time just create one vCPU, which you can map to more physical resources.

6
  • changing the number of processors in a Windows OS leads to trouble - This really only matters in Server 2003 and only if you're going from a single CPU to multiple. Server 2003 would install a uniprocessor HAL, and it would break when more were added, since it needed the multiprocessor HAL. This isn't a problem in 2008 and later, and it wasn't a problem in 2003 if you were going from, say, 2 CPUs to 3, since the multiprocessor HAL was already loaded.
    – MDMarra
    Aug 30, 2012 at 17:12
  • That's fair, that it's the single vs multi processor change... but I've read that this still applies in 2008 and 2008 R2. You're saying I've been misinformed... do you have anything I could read to correct my ignorance, if that's the case? Aug 30, 2012 at 17:18
  • The HAL "changes" automatically in 2008, since there's really only one HAL anyway. Not sure where there's a doc on this, but you can test it yourself by having a multiprocessor machine, looking at the HAL, P2Ving it to a single vCPU box and looking again. It will have seamlessly changed the HAL to the appropriate one. I'm sure there's a doc somewhere on it, but it was part of the whole hardware-independent HAL thing-a-ma-bob in Vista/2008.
    – MDMarra
    Aug 30, 2012 at 17:55
  • Your answer is factually wrong. See my response to this question. Sep 4, 2012 at 18:25
  • @JakeOshins Mine's not, but yours is. If you'd followed the link I provided, you'd have seen the portion of the setup screen where you assign the number of logical processors to the VM, which, in fact, was the OP's problem. If you assign two vCPUs to the guest, the guest sees two CPUs. Sep 4, 2012 at 18:56
2

Hyper-V in Server 2008 and Server 2008 R2 projects a virtual topology to the VM that looks like a single CPU with multiple cores. If you want to see this for yourself, download Coreinfo from Sysinternals. (Currently at http://technet.microsoft.com/en-us/sysinternals/cc835722)

Hyper-V in Server 2012 can project many different sorts of virtual topologies, which is useful for configuring workloads with lots of virtual processors. It will default to projecting topologies which match the physical topology, but you can override that.

Note that changing the topology projected into your VM can change the performance of the workload within, by causing the guest OS and application stack to make different configuration decisions. Merely changing the guest topology, though, can't bring you into licensing compliance.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .