We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38031
    • 15 Posts
    Hi, we just put a new modx site live - lawsonhammock.com, and i enabled database caching hoping it would speed things up a little.

    Except I am finding that with that caching on, certain pages would just load blank. I thought it was just my browser's cache at first, but then i heard from others who couldn't load the page as well (the manager wouldn't load for a while either). Everything is fine once i turned the caching back off.

    Should i file a bug report? We're using godaddy shared hosting running Revo 2.1.3. I'd like to optimize the site speedwise as much as possible...
      • 22303 MODX Staff
      • 10,725 Posts
      I do not recommend database caching with shared hosts at all. In most cases, it is not necessary unless you are using an external database server. That said, it is also somewhat broken in 2.1.x, so I do not recommend using it until you decide to upgrade to a 2.2.x release (when available).
        • 1343 ☆ A M B ☆
        • 2,213 Posts
        GoDaddy wouldn't be my first choice for high speed MODX hosting, however the speed shouldn't be terrible. If you elaborate on the site (what snippets/plugins/etc) do you have, what if anything is uncached, perhaps we can make some other suggestions.

        The next best move would be getting the database and webserver on the same box. It should speed things up a tad as there is no latency introduced.
          Patrick | Server Wrangler
          About Me: Website | Tweets |  MODX Hosting
          • 38031
          • 15 Posts
          then i may just leave it as is and recommend a server upgrade for my client if he wants faster load times... plus upgrade to 2.2 (anticipating the release!)

          Thanks for your help
            • 38031
            • 15 Posts
            Update:

            I discovered another ocurrence of a blank page, noticed in the modx error log that there were some errors connecting to godaddy's mysql database. So it wasn't an issue with the database caching at all, just coincidence. Hopefully this problem is on godaddy's end not modx.
              • 38031
              • 15 Posts
              Okay, still need help on this, and verified that this is not database caching related.

              Every 6 - 8 hours the site drops and loads blank pages (no html code). I have to clear the cache in the manager or if the manager doesn't load delete the cache files manually to restore it.

              I upgraded from 2.1.3 to 2.1.5 but am still having the same issues. I've reset all the file permissions but that didn't help. I was seeing errors in the manager related to 'Error caching lexicon topic' before the upgrade.

              This is running on a godaddy shared hosting with PHP 5.2.17, MYSQL 5.0.91. I run other modx sites on godaddy with no problem.

              This is frustrating because the site is live - I have a monitoring service that is telling me when it hangs so I can manually restore it each time. Thanks for any help.
                • 22303 MODX Staff
                • 10,725 Posts
                When you encounter this next, before clearing the cache, inspect the core/cache/resource/context_key/resources/resourceid.cache.php file, where context_key is web or whatever context the blank resource occur in, and resourceid is the id of the resource that is coming back blank. This sounds very odd.
                  • 38031
                  • 15 Posts
                  Alright, checked when it occurred last, and there were cache files for other resources (2.cache.php, etc.) but none for the home page which was crashing (1.cache.php).

                  here is a sample of errors from the error log:

                  [2012-01-02 07:47:21] (ERROR @ /index.php) Error caching lexicon topic lexicon/en/gallery/properties
                  [2012-01-02 08:32:32] (ERROR @ /index.php) Could not cache context settings for web.
                  [2012-01-02 08:32:33] (ERROR @ /index.php) Error caching lexicon topic lexicon/en/gallery/properties
                  [2012-01-02 08:32:33] (ERROR @ /index.php) Error caching lexicon topic lexicon/en/gallery/web
                  [2012-01-02 09:26:02] (ERROR @ /assets/components/gallery/connector.php) Error caching lexicon topic lexicon/en/gallery/default
                  [2012-01-02 09:26:02] (ERROR @ /assets/components/gallery/connector.php) Error caching lexicon topic lexicon/en/gallery/default
                  [2012-01-02 09:35:21] (ERROR @ /index.php) Could not cache context settings for web.
                  [2012-01-02 11:23:09] (ERROR @ /index.php) Could not cache context settings for web.
                  [2012-01-02 12:08:04] (ERROR @ /index.php) Could not cache context settings for web.
                  [2012-01-02 12:42:02] (ERROR @ /index.php) Error HY000 executing statement:
                  Array
                  (
                  [0] => HY000
                  [1] => 2006
                  [2] => MySQL server has gone away
                  )

                  [2012-01-02 12:42:02] (ERROR @ /index.php) Error HY000 executing statement:
                  Array
                  (
                  [0] => HY000
                  [1] => 2006
                  [2] => MySQL server has gone away
                  )

                  [2012-01-02 12:42:02] (ERROR @ /index.php) Error HY000 executing statement:
                  Array
                  (
                  [0] => HY000
                  [1] => 2006
                  [2] => MySQL server has gone away
                  )

                  [2012-01-02 12:42:02] (ERROR @ /index.php) Error HY000 executing statement:
                  Array
                  (
                  [0] => HY000
                  [1] => 2006
                  [2] => MySQL server has gone away
                  )

                  [2012-01-02 12:42:02] (ERROR @ /index.php) Error HY000 executing statement:
                  INSERT INTO `modx_session` (`id`, `access`, `data`) VALUES ('292e5071dadfb9e1a9f7b2e16ba73e85', 1325533322, 'modx.user.0.attributes|a:1:{s:3:\"web\";a:3:{s:16:\"modAccessContext\";a:1:{s:3:\"web\";a:1:{i:0;a:3:{s:9:\"principal\";i:0;s:9:\"authority\";s:1:\"0\";s:6:\"policy\";a:1:{s:4:\"load\";b:1;}}}}s:22:\"modAccessResourceGroup\";a:0:{}s:17:\"modAccessCategory\";a:0:{}}}modx.user.0.resourceGroups|a:1:{s:3:\"web\";a:0:{}}modx.user.contextTokens|a:0:{}modx.mgr.user.token|i:0;')
                  Array
                  (
                  [0] => HY000
                  [1] => 2006
                  [2] => MySQL server has gone away
                  )

                  [2012-01-02 12:53:00] (ERROR @ /index.php) Error caching lexicon topic lexicon/en/gallery/properties
                  [2012-01-02 14:22:49] (ERROR @ /index.php) Error caching lexicon topic lexicon/en/gallery/properties
                  [2012-01-02 18:09:00] (ERROR @ /assets/components/gallery/connector.php) Error caching lexicon topic lexicon/en/gallery/default
                  [2012-01-02 18:09:00] (ERROR @ /assets/components/gallery/connector.php) Error caching lexicon topic lexicon/en/gallery/default


                  <b>Strict Standards</b>: strftime() [<a href='function.strftime'>function.strftime</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MST/-7.0/no DST' instead in <b>/home/content/78/8669578/html/core/xpdo/xpdo.class.php</b> on line <b>1630</b>

                  [2012-01-02 18:28:28] (ERROR @ /assets/components/gallery/connector.php) Could not cache context settings for mgr.


                  <b>Strict Standards</b>: strftime() [<a href='function.strftime'>function.strftime</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MST/-7.0/no DST' instead in <b>/home/content/78/8669578/html/core/xpdo/xpdo.class.php</b> on line <b>1630</b>

                  [2012-01-02 19:32:01] (ERROR @ /assets/components/gallery/connector.php) Could not cache context settings for mgr.
                  [2012-01-02 19:42:55] (ERROR @ /index.php) Could not cache context settings for web.
                  [2012-01-02 20:56:06] (ERROR @ /index.php) Error caching lexicon topic lexicon/en/gallery/properties
                  [2012-01-02 21:41:00] (ERROR @ /index.php) Error caching lexicon topic lexicon/en/gallery/properties
                  [2012-01-02 22:59:48] (ERROR @ /index.php) Error caching lexicon topic lexicon/en/gallery/properties


                  I hope this helps, thanks once again
                    • 1343 ☆ A M B ☆
                    • 2,213 Posts
                    Generally when you see database server connectivity problems it means you are hitting a resource limit and your connection is being terminated. I suspect there is a limit put in place to protect other users on the server and this site is hitting that limit.

                    I would say this issue is specific to GoDaddy and unless they increase the limits, you will continue to have problems. I know gallery can cause problems running on shared servers. If you want try disabling it to see if there is any difference.

                    I can suggest some other hosting providers if you wish to go that route.
                      Patrick | Server Wrangler
                      About Me: Website | Tweets |  MODX Hosting
                      • 38031
                      • 15 Posts
                      Hi AMDbuilder,

                      Godaddy's database server allows 200 concurrent connections.

                      Site traffic right now is only 7 - 8 people per hour really.

                      I guess other hosting providers would be an option although I don't enjoy transferring servers with modx.

                      Is there a way to optimize the site better? (not use gallery although i really like letting users manage the albums for slideshows etc)