2009年4月8日 星期三

memcache , sphinx utf8 memo

memcache FAQ

節錄一下
去增加或移除你的server 設定是很危險的, 因為這樣你的hash 也會變
memcache object 會對塞進它的key 做hash 來決定這個key mapping 到哪個memcache server, 就算是memcache server 掛掉, 也會rehash 寫到另外的server 所以你只要用memcache object 來set/get , 就算是100台memcache server 也是一樣, 它會自己去找到它應該去找去砍的memcache server

default clients adding or removing servers will invalidate all of your cache! Since the list of servers to hash against has changed, most of your keys will likely hash to different servers. It's like restarting all of your nodes at the same time.

Use the old default "key rehashing" mode. If a memcache client detects a down server, the previous default behavior was to pick another server and set/fetch the data from there. This can be dangerous if you have a server that "flaps" up and down, as you can end up with stale data on broken and working servers.



Ultrasphinx 搜尋不到中文的解決方法
config/database.yml 加一行 encoding: utf8

沒有留言: