provide better way to set worker_cpu_affinity for physical and virtual machine
September 13, 2021 08:34AM
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.

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 112
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready