Magento Session Storage – Redis vs. Memcached Comparison

ee-1.12magento-1.7memcacheredissession

I'm running a Magento EE 1.12.2 (equally in CE 1.7.2) where we have Redis for caching (Cm_Cache extension, Redis v 2.2.12), but we use Memcache for session storage.

Redis is not supported out of the box on these Magento versions. So my concern here is:

  • Is it worth the hassle to get session storage into Redis in terms of effort vs. speed improvement?
  • Isn't Memcache just as good or maybe even better?

In this project we have large session files as we need to store third-party XML files into the session, so optimizing session read and writes can have a considerable impact.

From local.xml:

<session_save><![CDATA[memcache]]></session_save>

And:

<cache>
    <backend>Cm_Cache_Backend_Redis</backend>
    [...]
</cache>

Best Answer

As per as my concept Redis is most good:

Memcached is Free & open source, in-memory key-value store, high-performance, distributed memory object caching system.

Redis is an open-source, networked, in-memory, key-value data store with optional durability.

Because of

  1. Memcached is a volatile in-memory key/value store. Redis can act like one (and do that job as well as Memcached)
  2. It's architecture is suitable for faster save data.
  3. Data fetch faster
  4. Persistence to disk, by default
  5. Values up to 512MB in size (Memcached limited to 1MB per key)
  6. Built in clustering

Redis doesn't support LRU or any similar policy for handling overload Redis doesn't support CAS (check and set) which is useful for maintaining cache consistency - see What are the most common sources of Memcached cache inconsistency? (though there is a SETNX operation that makes this unnecessary)

enter image description here

More details: Stackoverflow "Memcached vs. Redis?"

Some details with Redis faster data support: Redis.io

Related Topic