exptime unclear

Neulinger, Nathan nneul at umr.edu
Wed Dec 20 14:25:12 UTC 2006


What version of memcached are you running? There was a bug that sounded
a lot like this fixed a while back.

-- Nathan
 
------------------------------------------------------------
Nathan Neulinger                       EMail:  nneul at umr.edu
University of Missouri - Rolla         Phone: (573) 341-6679
UMR Information Technology             Fax: (573) 341-4216
 

> -----Original Message-----
> From: memcached-bounces at lists.danga.com 
> [mailto:memcached-bounces at lists.danga.com] On Behalf Of Adam Dixon
> Sent: Wednesday, December 20, 2006 12:11 AM
> To: memcached at lists.danga.com
> Subject: exptime unclear
> 
> Hello all,
> I have memcached running for our authentication systems, which hinges
> on the UNIX_TIMESTAMP(ExpireDate) which I use to also expire the
> memcached record.
> 
> What I have found is that, if a record is set, and the timestamp is
> already passed the current time, it caches it - and sometimes keeps
> it, whereas I would have thought it to dump it straight away as
> expired.
> 
> I would of thought that this was how it would work? Instead it appears
> to have something to do with how long the server has been up.
> 
> # perl y.pl 5700
> Setting key with exp of 1166588860
> The time is now 1166594560 which is -5700 seconds diff.
> memcached up for 5662, started at 1166588898 and exptime of -38
> Get key ... Gotit.
> memcached up 5662sec.
> Get key ... Gotit.
> .....
> memcached up 5667sec.
> Get key ... Gotit.
> memcached up 5668sec.
> Get key ... Gotit.
> memcached up 5669sec.
> ....
> 
> Ok so a object that's 5600 seconds old stays in the cache? for how
> long I don't know.
> 
> # perl y.pl 5600
> Setting key with exp of 1166588972
> The time is now 1166594572 which is -5600 seconds diff.
> memcached up for 5673, started at 1166588898 and exptime of 74
> Get key ...DontGotit.
> memcached up 5673sec.
> Get key ...DontGotit.
> .....
> memcached up 5676sec.
> Get key ...DontGotit.
> memcached up 5677sec.
> ....
> 
> This one however is not in the cache, which is to be expected.
> 
> Is there pseudo code for this process?
> Is this a bug or do I have to change all my application code to
> somehow handle this? OR I have it completely wrong.
> 
> Kind regards,
> Adam
> 
> 



More information about the memcached mailing list