We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47651
    • 1 Posts
    I have a hosting setup that is home to several different CMSs, a few of which are ModX (Evo/Revo). The setup consists of at lease two or more Ubuntu/Apache web heads, and a separate Ubuntu/Mysql database server. The servers are behind a load balancer and mirrored in a master/slave configuration. The slave is set to read-only and is kept in sync with the master through the use of Lsync and Varnish. Varnish's job in this case is purely to proxy traffic, specifically URLs that would potentially write to the server, to the master web head (since the slave is read-only). Memcached is used currently to store session data, and with a little configuration on some CMSs, we are able to make use of Memcached to store all caches.

    I've found a few, but not many, resources that cover configuring ModX to use Memcached for caching, and from the best of my ability I can tell that it's at least connecting to the Memcached server. I'm only using one partition on the Memcached server to store ModX cache, but plan to expand on this after I've confirmed that it's working properly. My Memcached settings in the main config.inc.php are as follows:

    $config_options = array (	
     'cache_handler' => 'cache.xPDOMemCached',	
     'memcached_server' => 'XXX.XXX.XXX.XXX:11211',	
     'resources_memcached_server' => 'XXX.XXX.XXX.XXX:11211',	
     'scripts_memcached_server' => 'XXX.XXX.XXX.XXX:11211',	
     'includes_memcached_server' => 'XXX.XXX.XXX.XXX:11211',	
     'system_settings_memcached_server' => 'XXX.XXX.XXX.XXX:11211',	
     'context_settings_memcached_server' => 'XXX.XXX.XXX.XXX:11211',	
     'custom_memcached_server' => 'XXX.XXX.XXX.XXX:11211',
     'cache_db' => true,
     'db_memcached_server' => 'XXX.XXX.XXX.XXX:11211',
    );


    However, when testing on the master server, the app is still writing page cache to files under 'assets/cache/'. The problem is, if traffic gets sent to that slave/read-only server, at best there just won't be any page caching, and at worse the page won't load properly.

    So...

    Can ModX Evo or Revo (preferably both), natively or through use of a module/plugin, be configured to store page cache in the database rather than on the server...or should we just configure Varnish to pass all requests for the ModX sites to the master? [ed. note: soupmagnet last edited this post 12 years, 5 months ago.]