Redis does not provide such a guarantee.
If you run 4 instances, there will be 4 different processes that the operating system will have to schedule on 4 cores. It is OS dependent to perform this load balancing while optimizing system performance.
Now, if you really want to bind each instance to a specific core, a modern OS usually provides tools to ensure that the process runs on a specific processor core.
For example, on Linux, you can see taskset and numactl .
In practice, you need to be careful with this, because as soon as you run Redis on a specific kernel (specify a processor mask), all threads and child processes will inherit from this processor mask. Therefore, when Redis tries to start a background save operation or rewrite background AOF, this will seriously affect the performance of the Redis instance. This is because the main Redis thread will share the processor core with a background operation (which usually consumes the processor).
If you really want to play with CPU binding (but is this really a good idea?), You need to bind N Redis instances to N + 1 kernels, leaving one core free for background operations, and make sure that these instances can run one operation at a time.
Didier spezia
source share