• I’m moving my fat wordpress blog from a single monster server to a cluster with 5 nodes. All of them have GlusterFS for replicating the public_html directory and Percona XtraDB replicating all databases.

    But I have W3 total cache on the wordpress site, and I have all caches set to disk. It grows to several gigabytes, so I can’t dedicate a memcached node to hold them up.

    I’ve been thinking about making the wp-content/cache directory as a symlink in the cluster so it points to a local place on every server, so, when a user hits one of them, he will get cached stuff from that specific server.

    Is it possible to get this scheme to work? Or is there any better practice?

    https://wordpress.org/plugins/w3-total-cache/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter lavacaballero

    (@lavacaballero)

    After hours struggling against an overwhelming traffic push by GlusterFS motivated by w3 total cache, I ended up splitting disk caches successfully. After some time monitoring, it seems it is all OK.

    So, basically, /home/foro/public_html is a GlusterFS mount. /home/foro/public_html/wp-content/cache is part of that, but inside that directory, I created a local directory to host db, object, page_enhanced and tmp. So the config will be part of the Gluster share but all cache files will be saved locally.

    Take a look at the listing so you can reproduce it:

    # ls -lah /home/foro/public_html/wp-content/cache
    drwxrwxrwx  3 apache apache 4.0K May 14 22:33 .
    drwxrwxrwx 16 foro   foro   4.0K May 14 22:29 ..
    drwxr-xr-x  2 apache apache 4.0K May 14 22:11 config
    lrwxrwxrwx  1 foro   foro     29 May 14 22:33 db -> /home/foro/wordpress_cache/db
    -rwxrwxrwx  1 foro   foro      0 May 22  2015 index.html
    lrwxrwxrwx  1 foro   foro     33 May 14 22:33 object -> /home/foro/wordpress_cache/object
    lrwxrwxrwx  1 foro   foro     40 May 14 22:33 page_enhanced -> /home/foro/wordpress_cache/page_enhanced
    lrwxrwxrwx  1 foro   foro     30 May 14 22:33 tmp -> /home/foro/wordpress_cache/tmp

    And good luck!

    Side note: this hack will force you to manually purge the cached objects through cron jobs on each server.

    Quick note. You should only use the page/minify from disk and try using object/database from memory. Because object caching can have in some sites 12k+ files (Even on small sites). Database caching can be smaller maybe 200 on a small site. But there are still a lot of files.

    Thread Starter lavacaballero

    (@lavacaballero)

    Actually, my idea didn’t work fine, specially because at some point users may inadvertently switching servers, having unexpected results and annoying white pages.

    I needed to switch to memcached and setup a single server with a 1gb pool and a smaller TTL, and have all servers connecting to it. It is working fine though.

    So no. It is a bad idea to split disk caches as I wanted.

    Don’t do it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is it possible to split the disk caches on a cluster?’ is closed to new replies.