Open haihq88 opened 7 years ago
How Can i configure to store Session ID to 2 memcached servers in a pool? Currently, it stores only one memcache server.
@haihq88 how many items do you put in? how about add more than 1000 items :)
I do not have 1000 items for now :) But i want to have failover incase one memcached server is down, clients session will not be lost.
@haihq88 because it is hash, so in small numbers of items, it shows like your situation. It looks like throwing dice.
@charsyam Do you mean when i have many numbers of Session ID, it will stores to more than 1 memcached server?
@haihq88 Yes. It will be distributed on your servers fairly
@charsyam Maybe you're misunderstanding me :) I mean, i want one key will store to more than 1 memcache servers. For example, my PHPSSEID=jhlni15gpp7c5dd7q3tht410l3; I want it stores to b1 and b2. Or maybe all of 4 memcached servers In case b1 is down. Twemproxy still can read it from b2 and client session will not be lost.
@haihq88 No. only one node just will store it. so If one node is down, you will lost some datas.
@haihq88: @charsyam is correct. Twemproxy is not meant as a redundant data store. You may want to look into some sort of application level session redundancy.
I have following setting for PHP session
When session created, how does it write to each memcache server? As i know, twemproxy is consistent hashing. Can we define number of memcache server will be written? for example, memcache has option memcache.session_redundancy=N