We are migrating from linode to aws and are seeing an issue where sessions are not persisting as expected.
On linode we had an instance which was running Twitter's twemproxy, which would handle the addition, and removal of nodes to the cache pool, and sessions persist as expected. If a node is removed (outage) then of course a session would be regenerated, otherwise, twemproxy will know how to retrieve the session data from online and registered cache nodes.
However on AWS we have an Elasticache instance setup as follows:
- 3 nodes total
- 2 nodes in AZ1
- 1 node in AZ2
- Open security group (in a private subnet with no outside access)
We setup DNS to point 'vcache' to the Elasticache endpoint, this way we don't have to manage any cache hostnames at the app layer. The app only knows to connect to vcache:22122
For some reason, session ids are being irregularly regenerated, and we are not sure why. As the Elasticache is a 'black box' interface, we are assuming that it will know how to access a key from a particular cache node, like with twemproxy, but this doesn't seem to be the case.
Did we miss something in the setup, or are we incorrectly assuming that Elasticache is a proxy that knows how to access data, even across AZ nodes?