rcbops / ansible-lxc-rpc

Ansible Playbooks to deploy openstack
https://rcbops.github.io/ansible-lxc-rpc/
Apache License 2.0
38 stars 31 forks source link

should not load balance memcache #373

Closed mancdaz closed 10 years ago

mancdaz commented 10 years ago

Normally memcached will place items using consistent hashing. This means that puts and gets of an item will always hit the same memcached server, so after the first put of the item it will always be found.

If hitting the load balancer, there is no control over where the item ends up. Subsequent gets may hit the memcached server that did not get the item in the first place, so the item is added to that servers cache. This is inefficient in terms of access times, but also in terms of memory usage since each node will effectively be acting independently rather than as a member of a cluster.

claco commented 10 years ago

Are you advocating not having it in the LB at all, or just changing it's config to a active/backup/backup model?

cloudnull commented 10 years ago

in our spec the first memcahced server is the primary and all others are backups, so as long as the primary never goes down you'd only every be communicating with the one memcached server. Presently this has been implemented in our HAProxy play as well as the the F5 config generator script.

This is the HAproxy configuration "https://github.com/rcbops/ansible-lxc-rpc/blob/master/rpc_deployment/vars/config_vars/haproxy_config.yml#L150-L156" which was replicated in the f5 config generator script.

mancdaz commented 10 years ago

@claco @cloudnull why not use all available memcache servers the way it was meant to be

cloudnull commented 10 years ago

In open to suggestions. What did you have in mind?

mancdaz commented 10 years ago

@cloudnull https://github.com/mancdaz/ansible-lxc-rpc/commit/f51294d2bcae7f23160436275a47b4f6656fc3f4

cloudnull commented 10 years ago

That seems sensible to me. Make it go. :)