We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15083
    • 697 Posts
    Hi guys,

    We are working on a load balanced environment using modRegistry in 'directory' => 'remotes' to synchronise file caches across web node.

    When we turn on cache_db = 1 the whole thing just stops working however?
    Web nodes no longer get registered.
    When I run a clearCache query from the CMS there are no registered nodes.

    If I set cache_db = 0 it starts working again!?!?

    Any help greatly appreciated smiley

    J

      • 22303 MODX Staff
      • 10,725 Posts
      It is possible modDbRegister instances do not work correctly with cache_db enabled. I'll do some local testing to see what the issue might be and report back. Is this using the latest 2.2.x release (2.2.4-pl)?
        • 15083
        • 697 Posts
        Hey,

        The version is MODX Revolution 2.2.0-pl2 (advanced)
        I have put in debugging, and with cache_db set modDbRegister does not save anything into the DB table.

        Cheers,

        J
          • 22303 MODX Staff
          • 10,725 Posts
          The bad news: I have cache_db set and cannot reproduce these issues with regards to not saving the messages into the table.

          The good news: I found and fixed another bug with modDbRegister instances when using the include_keys option.

          First thought: are you sure all the web server nodes have the proper date.timezone set matching the MySQL server timezone, and all are in sync in terms of the time that is set on the server?

          Second thought: How many $seconds do you have configured for the ttl in that plugin?
            • 15083
            • 697 Posts
            Hey,

            Thanks for the reply.

            I don't think I changed this, it's set to 1440.
            $seconds = !empty($seconds) ? intval($seconds) : 1440;


            And the code to register a node:
            $modx->registry->remotes->send("/distrib/instances/", array($instance => "{$instance}"), array('ttl' => $seconds));


            I'll have to check up on the server times, going to be a difficult one to check on all boxes.

            Cheers,

            J
              • 36818
              • 119 Posts
              The same behaviour with the "Forgot your login?" functionality at the login screen.
              This mecanisms also make use of the modRegistry.

              System Setting "cache_db" is on:
              1. click on "Forgot your login?"
              2. enter username
              3. email with activation link and new password is sent correctly
              4. NO entry in the DB table "register_messages"
              5. Login in via activation link is not possible (activiation link is not valid)

              System Setting "cache_db" is off:
              everything is working

              Tested on Revo 2.2.10

                • 22303 MODX Staff
                • 10,725 Posts
                I believe this was fixed since 2.2.10. If you upgrade to the latest and still experience the issue with modRegistry related features with cache_db enabled, would love to see an issue entered for it.
                  • 36818
                  • 119 Posts
                  Quote from: opengeek at Apr 28, 2014, 01:00 PM
                  I believe this was fixed since 2.2.10. If you upgrade to the latest and still experience the issue with modRegistry related features with cache_db enabled, would love to see an issue entered for it.

                  Thanks for the reply.
                  Retested on 2.2.14 (but not the same installation as 2.2.10 was) and it works. So, no need for an issue at github.