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.
In that you must scale Redis properly and let Redis handle the synchronization of data.
https://redis.io/docs/management/replication/
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.
Using Redis Sentinel or Redis Replication in combination with Predis as the client will automatically route read/write commands.