Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance comparison of MemCached with Disk Caching

I would like to know the performances of Memcached on remote server(on same LAN) with Disk Caching.Besides Memcached is a scalable cache solution, would there be any advantage of using Memcached with respect to performance when compared to disk caching.

Regards, Mugil.

like image 799
Mugil Ragu Avatar asked Jun 18 '10 01:06

Mugil Ragu


People also ask

Which is faster Redis or Memcached?

Redis uses a single core and shows better performance than Memcached in storing small datasets when measured in terms of cores. Memcached implements a multi-threaded architecture by utilizing multiple cores. Therefore, for storing larger datasets, Memcached can perform better than Redis.

Why is Memcached faster?

Like Redis, Memcached is an open source way to store key value pairs in memory, meaning that data is very quickly retrieved. This makes Memcached another way to return data where speed is a factor.

How much faster is a cache than DB?

A single server. A system with a single thing in it, which when cached, gets 100% cache hits and lives forever. A Hibernate Session. load() for a single object is about 1000 times faster from cache than from a database. .


1 Answers

From my personal experience I've found memcached isn't as fast as disk cache. I believe this is because of the OS's disk IO's caching, but memcached allows for a "scalable" cache, meaning if you have more than 1 server accessing the same cache data, it will scale (especially since memcached have a very low CPU overhead compared to PHP). The only way to allow more than 1 machine to access a disk cache at once is network mount which is surely going to kill the speed of the accesses. Also one other thing you have to worry about with file caching is garbage collection to prevent disk from being saturated.

As your site(s) scale, you might want to change your mind later, so whatever choice you make, use a cache wrapper, so you can easily change your method. Zend provides a good API.

like image 168
Kendall Hopkins Avatar answered Oct 27 '22 00:10

Kendall Hopkins