Sliding expiration
Ray Krueger
raykrueger at gmail.com
Fri Apr 18 15:53:32 UTC 2008
Let me make an attempt at explaining my understanding. Hopefully it
isn't wrong :P
Setting no expiration is probably not what you want to do. Have a look
at this entry in the FAQ:
http://www.socialtext.net/memcached/index.cgi?faq#when_do_expired_cached_items_get_deleted_from_the_cache
Items are removed after their cache-time expires when:
...a client tries to retrieve the expired data.
...when the space the expired item is holding is needed.
When memcached needs to reclaim space in that second scenario; it uses
a "Least Recently Used" list to decide what space to reclaim.
Some good info here...
http://semanticvoid.com/pages/memcached.html
On Fri, Apr 18, 2008 at 10:09 AM, a. <a at enyim.com> wrote:
> Sliding expiration T means that every time an item is accessed it's
> "expiration counter" is reset, and only evicted if it was not accessed for T
> duration.
>
> I.e. adding an item for 5 min sliding expiration means that it's evicted
> after 5 mins if no one accessed it. If the item is retrieved in that 5 min
> segment, the system will wait for another 5 mins before making it expired.
>
>
>
>
> a.
>
>
>
>
>
>
> On Apr 18, 2008, at 4:45 PM, Michael Wieher wrote:
>
> > Well, I'm not sure either, but some googling brough up a buncha msdn2
> > / asp related things.... I sorta glanced and it seems like a FIFO
> > idea, more or less, which brings up a question I have, although I have
> > no idea if the original poster was wondering this but um
> >
> > time_t(0) when setting an object in the cache
> > ....time passes....more objects get set....some time_t(0) some
> time_t(n)...
> > set-new-object time_t(0 or n) ... but cache is full...
> >
> > does it reject the new object
> > or throw out the oldest time_t(0) object?
> > or throw out the oldest time_t(n) object where n>0 but n-has-expired?
> >
> > if i wanted a pure FIFO cache, just set all expiration to NULL?
> >
> > On Fri, Apr 18, 2008 at 8:24 AM, Brian Moon <brianm at dealnews.com> wrote:
> >
> > > Can you explain? I am not sure what you mean by sliding.
> > >
> > > Brian Moon
> > >
> > >
> > >
> > > On Apr 18, 2008, at 1:56 AM, "Simone Busoli" <simone.busoli at gmail.com>
> > > wrote:
> > >
> > >
> > >
> > > > Hello, I have a question about the expiration policy employed by
> > > >
> > > Memcached. Does it support sliding expiration out of the box or does it
> have
> > > to be managed at the application level?
> > >
> > > >
> > > >
> > >
> > >
> >
>
>
More information about the memcached
mailing list