Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can memcached make full use of multi-core?

Is memcached capable of making full use of multi-core? Or is there any way tuning this?

like image 239
Mickey Shine Avatar asked May 28 '10 08:05

Mickey Shine


People also ask

Does multi threading use multiple cores?

Multithreading refers to a program that can take advantage of a multicore computer by running on more than one core at the same time.

How fast is Memcached?

memcached can process over 50 million keys per second on a 48 core machine using only RAM and heavy batching.

Is memcached a distributed cache?

With Memcached you can build highly scalable distributed caching solutions designed to provide fast and consistent performance.


Video Answer


2 Answers

memcached has "-t" option:

       -t <threads>
          Number of threads to use to process incoming requests. This option is only meaningful
          if memcached was compiled with thread support enabled. It is typically not useful  to
          set  this higher than the number of CPU cores on the memcached server. The default is
          4.

so, I believe it can use all your CPU cores, of course if it was compiled with corresponding option.

like image 89
zed_0xff Avatar answered Oct 11 '22 22:10

zed_0xff


memcached is multi-threaded by default and has no problem saturating many cores. It's a bit harder to saturate all cores on more massively parallel boxes (e.g. a 256-core CMT box) just because it gets harder to get the data in and out of the network.

If you find areas where some sort of contention is preventing you from saturating cores, file a bug or start a discussion.

like image 6
Dustin Avatar answered Oct 11 '22 21:10

Dustin