使用多個memcached server 時用逗號","隔開,並且和 Memcache::addServer() 文檔中說明的一樣,可以帶額外的參數"persistent"、"weight"、"timeout"、"retry_interval" 等等,類似這樣的:"tcp://host1:port1?persistent=1&weight=2,tcp://host2:port2" 。
也可以直接telnet到Memcached中用get session_id來查找Session數據 [root@CentOS_Test_Server ~]# telnet 192.168.1.111 11211 Trying 192.168.1.111... Connected to 192.168.1.111 (192.168.1.111). Escape character is '^]'. get 7c694d1c2fea5dd3c56f7a19d2f925c9 VALUE 7c694d1c2fea5dd3c56f7a19d2f925c9 0 18 time|i:1251362209; END set name 0 0 10 caihuafeng STORED get name VALUE name 0 10 caihuafeng END
保存在Memcached中的數據最長不會超過30天,這個時間是以操作Memcached的時間爲基準的,也就是說,只要key還是原來的key,如果你重新對此key進行了相關的操作(如set操作),且重新設置了有效期,則此時此key對應的數據的有效期會重新計算的,php手冊中有說明 Expiration time of the item. If it's equal to zero, the item will never expire. You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days).