Jump to content
RESET Forums (homeservershow.com)
itGeeks

Hyper-V allocating Cores?

Recommended Posts

itGeeks

You can allocate access to a core, it doesn't take complete control over the core, same as having an app that can use multiple cores, doesn't stop anything else using them at the same time...

Thank you for the clarification on this, How does one know when its to much?

Share this post


Link to post
Share on other sites
Trig0r

You can give a VM access to a core but it might not need it, keep an eye on task or resource manager and you'll see it load up as cores are being used, you can also give a max load as well iirc so you can stop a VM, even if it has access to all cores maxing a CPU out and making the system non responsive..

Hyper-V is pretty good with CPU and RAM utilisation these days tbh..

Share this post


Link to post
Share on other sites
itGeeks

First let me say I am very great full for everyone's response in trying to help me so please don't take any offense to what I am about to say. After all your great help and after thinking I finally understand what I needed to do I opened up the settings for my Hyper-V VM to change the amount of cores I am using from 2 to 4 as I am using a Xeon E3 1231 v3 processor and it has 4 cores, jmwills said Hyper-V would not allow you to allocate more cores then the CPU has so I decided to test that and found out that I could allocate 8 virtual Processors and I said to myself what? So I looked up the specs on my processor and found out that it has 4 cores & 8 threads so it seems that Hyper-V allows you to allocate up to the amount of threads you have and is not restricted to cores so I went on a Qwest to find out whats going on and I found this great post below that cleared everything up for me so I wanted to post it for others that maybe confused about all this as I was. Its a great read and should clear up any uncertainties anyone has on this topic.

http://www.virtualizationadmin.com/articles-tutorials/microsoft-hyper-v-articles/general/maximizing-your-virtual-machine-density-hyper-v-part4.html

 

The specs on my processor are here http://ark.intel.com/products/80910/Intel-Xeon-Processor-E3-1231-v3-8M-Cache-3_40-GHz

 

Again I want to thank everyone that tried and helped, I hope someone finds my link to the post helpful as I know I did.

Edited by itGeeks

Share this post


Link to post
Share on other sites
jmwills

One man's cores are another ma's threads...LOL  I think you get the gist of what I meant.  Hyper_V console refers to "processors" so in my case I have rwo six core sockets or 12 processors.

Share this post


Link to post
Share on other sites
GotNoTime

After all your great help and after thinking I finally understand what I needed to do I opened up the settings for my Hyper-V VM to change the amount of cores I am using from 2 to 4 as I am using a Xeon E3 1231 v3 processor and it has 4 cores, jmwills said Hyper-V would not allow you to allocate more cores then the CPU has so I decided to test that and found out that I could allocate 8 virtual Processors and I said to myself what? So I looked up the specs on my processor and found out that it has 4 cores & 8 threads so it seems that Hyper-V allows you to allocate up to the amount of threads you have and is not restricted to cores so I went on a Qwest to find out whats going on and I found this great post below that cleared everything up for me so I wanted to post it for others that maybe confused about all this as I was.

You need a bit of background on how this all works together.

 

Your CPU has 4 physical cores which are basically 4 individual processors jammed into a single chip. Each core can go off and do its own thing independently. Somebody figured out that a lot of the time, a core isn't actually 100% used. It'll be waiting for something to happen like memory access. The trick now is that you can sneak in and use the resources of this core for something else unrelated. The generic term for this is simultaneous multithreading and the Intel specific implementation is called Hyperthreading. The way they did this was just to pretend it is an entirely new core. The complication is that this new virtual core and the physical core are still sharing the same resources. You don't get 2x the performance since you're just exploiting idle time and it is possible for performance to be worse due to overheads.

 

Long story short is that your CPU has two numbers for cores. A number of physical cores which are the distinct processing units inside the CPU and a number of logical cores (threads on Intel ARK) which will be what is presented to your OS. A modern OS will be aware of the differences between them and try to spread out the load over as many physical cores as possible. Old OSes wouldn't have a clue and just assume all the logical cores were real physical cores as SMT/Hyperthreading wasn't mainstream back then. The issue there is that you may end up with everything scheduled to run on logical core #1 + #2 but both are the same physical core. There will be significant contention on those resources whilst logical core #3 + #4 are idle and entirely separate from #1 + 2.

 

Basically don't expect the same performance on every logical core as half of them will be sharing with the other half. You're fine to allocate as many as you want to your VMs but just be aware of how it all works. It won't break anything by adding 8 virtual processors to each VM but you may be adversely affecting performance due to overhead and the sharing.

Share this post


Link to post
Share on other sites
artiom

In practice the hyperthreading overhead will be noticeable only under permanently high CPU load. On modern OSes the process scheduler is well aware of hyperthreaded CPUs and will distribute the load optimally unless specific CPU affinity is configured. I have 13 VMs (each having 4 to 8 logical cores) running at the same time with some other tasks on host like replication, backup and file sharing and the only bottleneck is the HDD performance.

Share this post


Link to post
Share on other sites
Trig0r

I missed the comment about allocating more cores than a CPU actually has, but yeah, idle time and so on means certain parts of a core can do other things, hence the whole thread thing.

If you look at most modern CPU's it'll say something like Cores 2/4 meaning 2 actual cores but 4 threads, a hypervisor will see 4 vCPU and let you allocate accordingly, as mentioned above you won't get the same performance as a true core but the hypervisor will allocate CPU time as and where it is needed pretty well and keep things moving, especially if you do cap the VM's at say 80% of max CPU load, will always leave you 20% for the host regardless of how much work the VM's are doing..

Share this post


Link to post
Share on other sites
GotNoTime

In practice the hyperthreading overhead will be noticeable only under permanently high CPU load.

Yup. It is usually only an issue when you're doing the same thing across all the logical processors and they're all under heavy load. I only ever see it in research or finance applications. Stuff like number crunching for statistics where the instruction mix will be very similiar so the same units inside the core are needed by both logical processors.

Share this post


Link to post
Share on other sites
itGeeks

Wow, Some really great info from all of you. Every time I think I understand it turns out I don't :( OK so when we are dealing with VMs and vCores we are dealing with "logical cores" and not "physical cores" and that's y I was able to set it to 8 instead of maxing out at 4, So when planing on setting up VMs number of "threads" are your friend?

 

​Thanks again to everyone for your help in trying to understand all this...

Share this post


Link to post
Share on other sites
Gmb1986

Best practice is to start with 1 vCPU / Core and see how it goes.. add more if necessary rather than work the other way around.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...