We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47774
    • 5 Posts
    I have been working on Modx Revolution 2.2.6+ from last 1 year and found major bug or issue with Modx speed in front end. Our live site used to stop working if we make any changes in any Resources.
    Main issue found in Modx is with its cache and its speed, if we make any changes in resource then all its cache get cleared automatically. And this leads to go site down when we try to access any page (see attached image). For this we tried to use cacheManager , getCache etc but not found too useful.
    When we checked Modx log, we found some huge list of errors with "MYSQL Gone Away" while the same site used to start working after 10-15 minutes of refresh. For resolving "Mysql Gone Away" we tried to modified mysql setting with following detail for master and slave too

    key_buffer = 4096M
    max_allowed_packet = 300M
    table_cache = 4096
    sort_buffer_size = 2024M
    read_buffer_size = 512M
    read_rnd_buffer_size = 64M
    myisam_sort_buffer_size = 2024M
    thread_cache_size = 16
    query_cache_size = 512M


    But again unsuccessful in speed optimization with modx. If we talk about hardware, we already have implemented modx site on LOAD BALANCER. We have two live sites in modx but having the same issue.
    So, finally we decided to migrate site to some other PHP Framework. But still if any one can help let me know.
    Will Modx performance have a solution or it will be marked as a major BUG ? [ed. note: erakhil08 last edited this post 12 years, 3 months ago.]
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      The behaviour you're describing of the entire cache getting cleared is by design; if it didn't you would not be able to see the changes when you are reusing content across the site.

      However, the entire site going down after a cache clear is a serious problem.

      How many hits are you getting? You mention a load balancer, so I can imagine you may get a little more than the average joe's site, but knowing some context can help. One master server, and one slave? Are those web servers with a shared database server or is there replication there as well? Do you have a certain publishing workflow or are editors just writing and continuously saving edits on the live site? How often is content changed and published?

      If you're still on 2.2.6, you will definitely want to prioritise and upgrade sooner rather than later as some security issues were fixed in more recent versions and there have been some minor speed boosts along the way too.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 47774
        • 5 Posts
        Our main problem is both the sites (On Modx Rev 2.2.6 and 2.2.9) stops responding for about 10-15 minutes on clearing cache. To recreate cache manually we have fetch each url for 10-15 minutes on regular refresh. This is really frustrating.
        For one web sites on load balancer we are using 3 web server and 2 database server. Don't think any issue from H/W side. I just went through recent changes that have been made after 2.2.9 on https://raw.githubusercontent.com/modxcms/revolution/v2.2.14-pl/core/docs/changelog.txt but there were no recent updates related to speed optimization after 2.2.9.
        Its a TV channel website with an average more users but not too many, as we already have sufficient hardware. I have tried all the logic that we can found on web from Optimization with getCache and Custom Cache Partitions but all failed from getCache to CacheManager, including db_cache.
        Scene is only fine till the cache persists and the time cache cleared (which is default on change) everything goes down. I have not seen CMS like this, since i have worked on Drupal, Joomla, Wordpress.
        Hope, there must have some solution to this!


        Quote from: markh at Jun 12, 2014, 05:26 AM
        The behaviour you're describing of the entire cache getting cleared is by design; if it didn't you would not be able to see the changes when you are reusing content across the site.

        However, the entire site going down after a cache clear is a serious problem.

        How many hits are you getting? You mention a load balancer, so I can imagine you may get a little more than the average joe's site, but knowing some context can help. One master server, and one slave? Are those web servers with a shared database server or is there replication there as well? Do you have a certain publishing workflow or are editors just writing and continuously saving edits on the live site? How often is content changed and published?

        If you're still on 2.2.6, you will definitely want to prioritise and upgrade sooner rather than later as some security issues were fixed in more recent versions and there have been some minor speed boosts along the way too.
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          If you have dozens or hundreds of users hitting the site simultaneously with a cold cache, you will be putting a lot of load on the database. That load is killing the database server(s), as shown by the MySQL Server has gone away errors. So saying there is no hardware problem is not entirely correct as you evidently don't have sufficient resources during those peaks, but I agree the solution is not to throw more hardware at it - lowering the stress on the server is the way to go.

          If you are open for it, I would advise to get in touch with the MODX team. They often work with large companies and have quite some experience dealing with the complex sites that need a bit more than what the core handles out of the box. You can work with them to evaluate the set up and to find out what would really help. Arguably fixing the issues you have would be a lot more cost effective than moving to a different platform.

          There is no "one size fits all" solution for sites with major traffic, but there are a bunch of tricks that can be used and when used together they can resolve the problems you are seeing.

          - Prevent the cache from getting cleared when editing pages which have not yet been published - if your publishing workflow includes editing stuff on the master site directly, this can be a quick win. I believe there is a plugin written by Bob Ray available that will do this for you but don't recall the name. Bob might pitch in with the name later; he's very active on these forums.

          - If you're seeing heavy I/O, switching to a different cache handler (memcache(d) / redis) instead of the default file one could help with that, however be careful to make sure there is a lot of I/O causing bottlenecks before switching this as it could bring new problems of its own when not done right. It mostly sounds like a database load issue to me, but wanted to throw this out there as it could help.

          - Use getCache with a custom cache partition to keep the fixed bits and pieces that can be heavy to load/parse (such as menu structures, external feeds) separate from the resource cache. While people often say MODX "clears the entire cache" after a resource save, that is not technically true as it only clears the resource cache while other partitions remain. Taking advantage of that can be a huge win when done right.

          - Use microcache to instruct browsers to cache the page output. This can be a big boost for the user while also lowering the load on the server, but must be done right again. See http://www.sepiariver.ca/blog/modx-web/modx-quick-tip-microcache and https://github.com/opengeek/microcache/wiki

          - Find a way (read: custom development) to prime the cache on your slaves. This is super-specific to your environment and publishing process, but if you would have a small master server that is only used by the editors for generating content, you could create a button in the manager they can click that will automatically generate the cache on the master server, and then push that cache to the slaves along with the updated database. That way you would avoid having a cold cache to begin with.

          I don't know too much about how other CMSs handle their caches and cache clears, but I am pretty sure other systems will also encounter application specific issues when scaling.
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.