VMware Cloud Community
nimicyy
Contributor
Contributor
Jump to solution

affinity

hi,

when the workload is high (the average cpus load >80%) then is better to run any VM on a certain cpu -affinity.right?

by pinning the VM to certain cpu ->affinity.

Reply
0 Kudos
1 Solution

Accepted Solutions
scott28tt
VMware Employee
VMware Employee
Jump to solution

I wouldn't use an affinity "just because" a VM uses a lot of CPU.

If you did use an affinity for that VM, vSphere won't hold those CPU cores for exclusive use - it may still schedule other VMs on those cores unless you set affinity on all your other VMs to tell the scheduler not to use those cores for others.

So, if all you did was give that 1 VM an affinity, you may find it performs worse than before as you are restricting the CPU scheduler in the hypervisor.

Never mind the technical challenges highlights in those articles I linked to, it's just an administrative pain.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog

View solution in original post

Reply
0 Kudos
4 Replies
T180985
Expert
Expert
Jump to solution

Is that average CPU of a VM or Hosts? If you reserve 100% of a core(s) to a single VM then youre going to waste a % of those cores which could impact your other VMs

Please mark helpful or correct if my answer resolved your issue. How to post effectively on VMTN https://communities.vmware.com/people/daphnissov/blog/2018/12/05/how-to-ask-for-help-on-tech-forums
Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee
Jump to solution

I would use reservations over affinity.

Here's why:

https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.resmgmt.doc/GUID-199F1ADD-3B9B-490C...

Beating a dead horse - using CPU affinity - frankdenneman.nl


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
nimicyy
Contributor
Contributor
Jump to solution

i talk about host utilization.if cpus average load is hight that is better to use cpu reservation.right?

or if i do not need drs then i use cpu affinity.right?

Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee
Jump to solution

I wouldn't use an affinity "just because" a VM uses a lot of CPU.

If you did use an affinity for that VM, vSphere won't hold those CPU cores for exclusive use - it may still schedule other VMs on those cores unless you set affinity on all your other VMs to tell the scheduler not to use those cores for others.

So, if all you did was give that 1 VM an affinity, you may find it performs worse than before as you are restricting the CPU scheduler in the hypervisor.

Never mind the technical challenges highlights in those articles I linked to, it's just an administrative pain.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos