When do I need affinity rules for an application with a 3 tiered architecture with web front end, application tier and database on different VMs, and when do I NOT need them? What are the performance requirements that make that necessary and when is that introducing unneeded complexity?
It depends on your app and it's tolerance for the latencies introduced from VMs running on different hosts vs. the same host. I'd argue that in a normal environment the difference would be minimal but you would really have to test and see, then decide if that difference is worth the decrease flexibility/increased complexity of affinity rules.
Does this answer your question?
Yes it would depend on the increase in latency introduced by packets potentially going through a physical nic, over a wire to a switch, out the switch to another host, to that hosts physical nic, into the virtual switch and then to the other VM. What is a fair way to calculate that increase in latency - a ping test from esxcli to the other hosts vmkernel port?
That's one way. I'd recommend testing application performance though if possible.
In below 2 posts, I have explained some use cases where DRS affinity rules can be used :
DRS rules PART I: How to create VM-Host DRS affinity rule using vSphere API | vThinkBeyondVM
DRS rules PART II: How to create VM-VM affinity rules using vSphere API. | vThinkBeyondVM
How DRS rules are treated by vSphere HA: is vSphere HA aware of DRS affinity rules? | vThinkBeyondVM
Hope this helps you
