back

by LinuxBender·9y ago·view on hn ↗
This isn't specific to your question, but I have VM's that have 6 logical processors. I use taskset to set the affinity of all OS processes to logical proccesor 0. This doesn't work for some kernel threads, but it works for most processes. I then give haproxy a number of logical processors, or balance based on what is running on that VM.

On physical hardware I would use NUMA regions per set of applications as well to optimize the use of CPU cache and get lower latency to memory, but the overall memory availability will be reduced. This is done on some latency sensitive applications.

You can do similar things in Windows. There is probably a way in Mac, but I have never tried.

As others pointed out, there are many cases where doing all of this won't help, so it really depends on the problem you are trying to solve, or the optimization you wish to accomplish. There are certainly no one-size-fits-all solutions.