Hi All, when you put data into the memcached, why there is a time limit. What about you do not use the expiration, does it work?
Thanks Tony On Thu, Apr 7, 2011 at 8:17 AM, Bluntcoder <[email protected]> wrote: > Hello, > > I'm trying to write a tool that will show all the data inside > memcached, including expiry times of the keys. However I have run into > a big of a snag. It seems that the cache dump expiry times are lying > to me - or I'm not understanding what they do. > > Here's my experiment. In a php file, I do the following: > > 1) I set a key "foo" to expire in 200 seconds. > 2) I use get stats to get the current time of the memcached server, > Unix epoch format. > 3) I do a cache dump which retrieves all keys, and their expiration > times, in Unix epoch format. > > I find foo in the cache dump list and subtract the server time from > the expiry time. I expect it to be close to 200 (maybe 199 for network > lantecy or something). > > But instead I get -1, or sometimes 0. Based on the other key values > that were collected, and the fact the difference keeps on growing, I > am left to assume that the number in cache dump is *not* the expiry > time, but the time that the key was set. > > Could anyone from memcached confirm this? If this is true, is it > possible to retrieve the expiry time per key, somehow? > > Thanks, > Mark -- tony.cui happy new year
