

The first benefit of CPU affinity is optimizing cache performance. This way, limiting the process/application to one or more CPUs results in more "cache warmth" or "cache hits, " thus increasing overall performance. The second way is to bind the application to one or more CPUs, called “CPU pinning” or “CPU affinity.” Binding the application to a specific CPU or CPUs makes all the threads or child processes related to the application running on defined CPU/CPUs.

One way is to use priority tuning using the nice/ renice command. There are multiple ways to get more CPU and make your application work better and run more efficiently. So normally, you're not bothered about which CPU/core your application or process runs, as long as it runs. Modern systems typically have multiple CPUs and cores, which are shared among all running software by the kernel scheduler. CPUs run all applications and it's best if you understand how it works and how you can tune CPU usage to increase the performance of your applications.
