Support » Plugin: W3 Total Cache » Why is Memcached and Redis slower than reading from disk?

  • Resolved Plan9

    (@plan9)


    Hello

    I am curious why Memcached and Redis are both (slightly) slower than reading from disk on my VPS? My hosting company tell me Memcached and Redis are functioning fine on my server.

    Is there an additional setting in W3 Total Cache that I am missing? Or do you think that an SSD drive could be faster than RAM based caching methods?

    Thanks for any info

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @plan9

    Thank you for reaching out and I am happy to assist you with this.
    Can you please share if you are referring to the Page Caching method Disk: Basic or Disk: Enhanced?
    Thanks!

    Thread Starter Plan9

    (@plan9)

    Hi

    I am referring to both Basic and Disk Enhanced.

    For page cache, Basic and Disk Enhanced are both faster (or equal) to Redis, Memcached and APCu.

    And it is the same for Database Cache and Object Cache.

    Thread Starter Plan9

    (@plan9)

    Here are the stats from the setup page:

    Storage Engine Time (ms)
    None 137.78
    Disk: Basic 10.70 -92.23%
    Disk: Enhanced 9.38 -93.19%
    Redis 17.11 -87.59%
    Memcached 17.17 -87.54%
    APC 19.59 -85.78%`

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @plan9

    Thank you for the information.
    There is no straight answer to your question as the results may vary depending on the environment.
    W3 Total Cache’s Disk: Enhanced method is always recommended for Page Caching since this method serves cached pages using the server’s URL rewriting capabilities, skipping PHP and WordPress entirely.
    Memory-based caching is better used for DB caching and/or Object Caching. In some cases, depending on what you are trying to achieve, you can use Memory-based caching for Page Caching if for example, you wish to cache pages with the query string which is not possible with Disk: Enhanced, or if you need to use Page Fragment Cache.

    I hope this helps!
    Thanks!

    Thread Starter Plan9

    (@plan9)

    Hi Marko

    Thanks for your reply. For Database Cache these are the stats:

    Storage Engine Time (ms)
    None 241.98
    Disk 0.21 -99.91%
    Redis 0.25 -99.90%
    Memcached 0.51 -99.79%
    APC 0.19 -99.92%`

    You can see that all RAM caching offers no gain over disk caching. I find this puzzling.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @plan9

    It does not necessarily mean that Memory caching is faster than disk caching.
    Both disk caching and memory caching have their own advantages. Disk caching is more persistent.
    However, it’s better to use Memory caching for OC and DB caching to avoid storing huge amounts of objects and large DB on disk.
    Thanks!

    Thread Starter Plan9

    (@plan9)

    Hi Marko

    Thanks for your explanation. I think a lot of people assume memory caching will always be better / faster than disk.

    It’s useful to know this is not always the case.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @plan9

    You are most welcome.

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Why is Memcached and Redis slower than reading from disk?’ is closed to new replies.