close
今天在幫忙找一個bug,
trace到最後發現是某支程式藉由著memcached來當作對DB查資料的cache,
不過沒有指定任何timeout的時間, 當然memcached也就一直把東西堆著,
所以造成永遠抓到舊的資料...

memcached expire 的機制是 LRU, 最久沒被使用的先幹掉
不過這東西會一直被使用到, 所以造成永遠不會被清掉..

Ref:
http://tw.php.net/manual/tw/function.Memcache-set.php
Parameter expire is expiration time in seconds. If it's 0, the item never expires

結論:
PHP memcache set值的時候, 沒事要記得設 timeout 啊
arrow
arrow
    全站熱搜

    Izero 發表在 痞客邦 留言(0) 人氣()