To take advantage of multiple processors, Memcached can be run as multiple instances on different ports or servers. In this way, each instance will have its own single thread and can handle requests concurrently. However, it is important to note that this approach requires careful consideration of the distribution of data between instances to avoid overloading any one instance.
Here is an example of how to start multiple instances of Memcached on different ports using the
memcached -p 11211 memcached -p 11212 memcached -p 11213
In this example, we are starting three instances of Memcached on ports 11211, 11212, and 11213 respectively. Each instance will have its own single thread and can handle requests concurrently on its respective port.