Support » Plugin: Redis Object Cache » recommended settings

  • Resolved flecky

    (@flecky)


    hello till,

    thanks for the nice plugin you´ve made.

    i got a few small questions. i have a few backend servers and each server has redis running. in case i update a page, just the current server get´s purged and the others keep remaining. also wen users are surfing on the page, just redis get cached on that server insted on all machines.

    i was thinking about redis master-slave, but there will be only one master able to write. i also could set up one server with redis and all connect to them. but i think i would like to have each server having redis running, as they have a bunch of free memory left.

    are there any good recommendations how i can keep all backend servers having redis and keeing in syc? i dont want to purge manually.

    and if i go with the pro, i can install it on a few servers for a few websites, right? or are there some limitations?

    thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    Are all the backend servers running the exact same codebase / wp app?

    Thread Starter flecky

    (@flecky)

    hello till, yes everything is exactly same. i just use nginx proxy to redirect the user to a different backend server. mysql is galera. so it will be 100% same as well.

    i was thining about haproxy on each node and then redis master – slave. so writes go to the current master and reads on the local machine.

    not sure if cluster / sharding is overkill. what do you suggest?

    • This reply was modified 1 week, 2 days ago by flecky.
    Plugin Author Till Krüss

    (@tillkruess)

    In that you must scale Redis properly and let Redis handle the synchronization of data.

    https://redis.io/docs/management/replication/

    Plugin Author Till Krüss

    (@tillkruess)

    IMO Sentinel and Cluster are overkill.

    Thread Starter flecky

    (@flecky)

    hello till,

    i´m trying to route reads and writes. i´ve tried different settings.

    define( ‘WP_REDIS_SERVERS’, [

        ‘tcp://10.0.55.1:6379?database=3&alias=server1’,    ‘tcp://10.0.55.2:6379?database=3&alias=server2’,
      ‘tcp://10.0.55.3:6379?database=3&alias=server3’,
    ] );

    define( ‘WP_REDIS_CLIENT’, ‘phpredis’ );
    define( ‘WP_REDIS_DATABASE’, 3 );

    i also tried different settings with WP_REDIS_HOST, WP_REDIS_PORT, WP_REDIS_CLIENT (phpredis,predis etc) and also different ports for WP_REDIS_SERVERS with haproxy. i have haproxy writes on 6380 and reads on 6381. normal redis on 6379. but slave nodes arent forwarding. probably i´ve overseen some settings i guess. or is that only in premium version?

    is it somehow possible to route writes to the master and and reads to the slave locally?

    working szenarioo is when i used haproxy and route everything to the master node. whith haproxy i ideally need 2 ports. one read one write. is that somehow possible to set up with your plugin? i also have sentinel running if the master swiches.

    define( ‘WP_REDIS_SENTINEL’, ‘redis-primary’ ); wasnt´t helping too.

    thanks for your support.

    Plugin Author Till Krüss

    (@tillkruess)

    Using Redis Sentinel or Redis Replication in combination with Predis as the client will automatically route read/write commands.

    Thread Starter flecky

    (@flecky)

    thank you

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.