cpu topology is normally different on physical machine and virtual machine. if hyper-threading is enabled, on physical machine, cpu processor and core topology is usally like this (ignore physical id first):
processor core-id
0 0
1 1
2 0
3 1
but on virtual machine, the topology is usally like this:
processor core-id
0 0
1 0
2 1
3 1
this information can be found in /proc/cpuinfo.
the question is, when we use worker_cpu_affinity to set cpu binding, we must know this topology first, and set this argument to different way, for example:
on physical machine, we can set:
worker_cpu_affinity auto;
but on virtual machine, the more banlance way is:
worker_cpu_affinity auto 1010;
if we have massive machines, include physical machine and virtual machine in different cpu core number and cpu topology, set worker_cpu_affinity become more and more difficult, so we hope there is a better way to set worker_cpu_affinity for adjusting this situation.
thanks.