-
Notifications
You must be signed in to change notification settings - Fork 83
Add ENV_CPUS_ASSIGNED_MASK env variable #244
Comments
Since most of the applications that consume the the ENV VARs do so through a script, would it be possible to convert the CPU IDs to a mask within such a script? |
Manipulations with bits are gentle in python, and not so nice in script. Besides it is common practice to put mask of cpus near list of cpus. |
Hi @LilyaBu @lmdaly did you success using ENV_CPUS_ASSIGNED_MASK, I have problem with it like bellow: |
Hi @anvien0111, thanks for using CMK. Most likely your application doesn't use all allocated cores - this may happen if this is some kind of DPDK based application and there's only one packet polling thread there because e.g. there's only one network interface/port handled in that application, or the application has some extra args for pairing interfaces/CPUs. CMK only allocates the cores, it's up to the application to actually use them. |
Hi @przemeklal. Thanks for your answer, I have figure out I have problem with PythonLib psutil in here: when I set isolcpus=2-17,38-53 in boot/grup.cfg then using psutil.Process().cpu_affinity([2,3,4,5]) |
@przemeklal when I set isolcpus=2-17,38-53 these Cpus would'nt show in command |
@przemeklal @phillyb7 Sorry but I test taskset not work too. Because when I set isolcpus=2-17, 38-53 then I cannot use taskset to bind multi cores in this range to one tasks. |
@przemeklal @phillyb7 I check my docker info and kubelet is using 'Cgroup Driver: systemd' |
@przemeklal @phillyb7 The problem is conflict of isolcpu and taskset. I change to use systemd-Cpuaffinity then taskset and your code work well. Thanks |
@lamto20132223 great! And thanks for letting us now about the solution :) |
Some applications expect a mask of cpus on which they isolate themselves (pktgen, testpmd). For the convenience of running such applications in cmk containers, it is useful to add allocated CPUs to the ENV, not only in the list, but also in the form of a mask.
The text was updated successfully, but these errors were encountered: