3

I recently received the following ticket info regarding some caching issues on our magento installation, and have run into some stumbling blocks in diagnosing (thus obviously fixing, as well) the underlying issue:

saving changes to any static content in the admin is no longer invalidating that page in the cache. E.g., editing a few words on the 'About Us' page and saving doesn't change anything on the front end, we'd then need to refresh the entire FPC to see our tiny tweak

...snip...

The way it used to work (a few months back), is that upon saving a change, that page and only that page would update on the front end (taking a little longer to load because the cache for that page was invalidated).

At some point (not sure when), we began needing to flush the entire cache and redis cache for the change to appear, which meant the entire site's cache was cleared and everything loaded slowly (and the db takes a huge womping for a bit).

After a bit of that, we realized we didn't even need to flush the redis cache, as it seemed to make no difference, so we've just been flushing the magento cache after any changes ever since.

...snip...

essentially upon updating the FPC module a while back, redis seems to have been cut out of the process of flushing the cache, so potentially it's been disconnected and may be the culprit.

In attempting to diagnose this problem, I've verified that everything on an applicable magento devdoc seems to be set up correctly between FPC and redis, as far as I can tell. IE app/etc/local.xml has the correct options for an installation not using Zend_Cache.

If anybody has any other ideas, or pointers on documentation that may help further with this issue, I would be very grateful. I seem to be having a bit of an issue locating decent magento documentation, on some issues, on this project. Thanks in advance!


Addendum: contents of local.xml follow

<config>
    <global>
        <install>
            <date><![CDATA[Tue, 12 Aug 2014 09:19:47 +0000]]></date>
        </install>
        <crypt>
          <key>***[redacted]***</key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username>***[redacted]***</username>
                    <password>***[redacted]***</password>
                    <dbname>***[redacted]***</dbname>
                    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                    <model><![CDATA[mysql4]]></model>
                    <type><![CDATA[pdo_mysql]]></type>
                    <pdoType><![CDATA[]]></pdoType>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>
        <session_save><![CDATA[db]]></session_save>

        <redis_session>
            <host>127.0.0.1</host>
            <port>6379</port>
            <password>***[redacted]***</password>
            <timeout>2.5</timeout>
            <persistent></persistent>
            <db>2</db>
            <compression_threshold>2048</compression_threshold>
            <compression_lib>lzf</compression_lib>
            <log_level>1</log_level>
            <max_concurrency>6</max_concurrency>
            <break_after_frontend>5</break_after_frontend>
            <break_after_adminhtml>30</break_after_adminhtml>
            <first_lifetime>600</first_lifetime>
            <bot_first_lifetime>60</bot_first_lifetime>
            <bot_lifetime>7200</bot_lifetime>
            <disable_locking>0</disable_locking>
            <min_lifetime>60</min_lifetime>
            <max_lifetime>2592000</max_lifetime>
        </redis_session>

      <cache>
        <backend>Cm_Cache_Backend_Redis</backend>
        <backend_options>
          <server>127.0.0.1</server> <!-- or absolute path to unix socket -->
          <port>6379</port>
          <persistent></persistent>
          <database>0</database>
          <password>***[redacted]***</password>
          <force_standalone>0</force_standalone>
          <connect_retries>1</connect_retries>
          <automatic_cleaning_factor>0</automatic_cleaning_factor>
          <compress_data>1</compress_data>
          <compress_tags>1</compress_tags>
          <compress_threshold>20480</compress_threshold>
          <compression_lib>gzip</compression_lib> <!-- Supports gzip, lzf and snappy -->
        </backend_options>
      </cache>

      <fpc>
          <lifetime>86400</lifetime>
          <backend>Cm_Cache_Backend_Redis</backend>
          <backend_options>
              <server>127.0.0.1</server>
              <port>6379</port>
              <persistent>cache-fpc</persistent>
              <database>1</database>
              <password>***[redacted]***</password>
              <force_standalone>1</force_standalone>
              <connect_retries>1</connect_retries>
              <lifetimelimit>86400</lifetimelimit>
              <read_timeout>10</read_timeout>
              <compress_data>1</compress_data>
              <compress_tags>1</compress_tags>
              <compress_data>gzip</compress_data>
          </backend_options>
      </fpc>

    </global>

    <admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

marked as duplicate by B00MER, Keyul Shah, liyakat, Amit Bera, Marius Jun 20 '15 at 6:04

This question was marked as an exact duplicate of an existing question.

1

It sounds like cache invalidation isn't happening. There are some additional notes to consider from Colin about the module Cm_Redis used in default installations as well that offer more insight. Particularly the garbage collection nightly. You may also look over the issues of the module to see if any others have reported similar issues.

Also, running multiple Redis instances for sessions/blocks/FPC may also help the pruning processes.

AOE_TemplateHints module is good for identifying a state of blocks cache that may help you debug the issue.

  • 1
    Thank you for the information that you've given so far; it's been very valuable. I was wondering if you might suggest where these notes from Colin about Cm_Redis might be found. I will also continue looking through the other references that you've given. We're already using multiple Redis instances (three I believe). Thank you very much for your time & help on this matter, @B00MER. – Damon Getsman May 31 '15 at 17:09
  • 1
    I went ahead and edited the original post to included the contents of $INSTALLATION/app/etc/local.xml as per your request. I believe I've scrubbed it of all sensitive data. I'm seeing under the <fpc> section that the lifetime is set at 24 hours. I'm guessing that setting this to a shorter interval might bring about the behavior that we'd like to see; unfortunately I believe this would probably add an unacceptable amount of load avg to the server. Do you know if redis should automatically detect a static page modification (currently not happening)? – Damon Getsman Jun 15 '15 at 22:26
  • 1
    Also, I wanted to thank you again, and also mention that we'll be looking into Munin and/or other interfaces to Redis to gain a little more insight on the behavior. Still very grateful for any insight that you might be able to impart on the matter, of course. :) – Damon Getsman Jun 15 '15 at 22:27
  • 1
    I noticed you are using the same redis instance for each cache, it would be best to create a separate redis server instance for session, block and fpc. Also, you don't need to compress the FPC as its already compressed. This doc from Magento ECG may be helpful: info2.magento.com/rs/magentoenterprise/images/… – B00MER Jun 16 '15 at 17:32
  • 1
    Yet another small update to this issue (though probably very important): It looks like we're using the Lesti extension for FPC. Sorry for the previous ambiguity. Also, being as this was kind of a conglomeration of issues after the FPC<-->redis issue was solved, I opened a new thread with this issue trimmed down just to the important components. – Damon Getsman Jun 18 '15 at 22:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.