2021-11-01 1 minute read 0 Comments improve this post #command line | #linux


taskset is used to affine an application to a specific set of CPU cores; usally taking into account NUMA architecture.

CPU/memory affinity can improve performance of workloads that are performance-critical and/or that may be network-heavy.

Affining closely related applications on the same NUMA node can improve memory access latencies, and newtork-heavy workloads can take advantage of affining applications by scheduling network I/O on the same NUMA node as the NIC card to reduce the latency between the CPU and PCIe.


Find out how a process is affined

taskset -s -p <pid>

As an added bonus, here is how to find out a process’s affinity is set using ps:

ps -o pid,psr,comm -p <pid>

 Categories: #linux

Tech tips and command line fu found within this dojo