简体   繁体   中英

Does it matter which memcache server I connect to first?

I have 2 load balanced web servers and a DB server. Each one has 6GB of ram dedicated to memcache.

On the 2 web servers, I'm having issues with memcache where they don't seem to have access to the same pool of data, sometimes.

Currently I have it setup so each of the 2 web servers connects to localhost first, and then adds the other 2 servers to the pool. Should I keep the connection string the same and have both of them connect to the DB server memcache instance initially, and then add themselves to the pool after in the same order?

The order of the memcached servers in your list is important. Also important is not using "localhost", ever. The key hashes are built based on the pool of servers you have provided. If your data is different, the hashes come out differently.

http://code.google.com/p/memcached/wiki/NewConfiguringClient#Configuring_Servers_Consistently

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM