Re: memcache eviction policy

110 views
Skip to first unread message

Vinny P

unread,
Sep 27, 2012, 10:21:47 AM9/27/12
to google-a...@googlegroups.com
There are no guarantees with Memcache. Memcache can evict values whenever it wants to (mostly due to space pressures, but other reasons can cause Memcache to drop values as well). If you want Memcache to retain a value, you need to repeatedly access it; this hints to Memcache that this value is important and needs to be retained.

If you want long-term storage, you need to store to the datastore, Cloud SQL, Cloud Storage, etc.

-Vinny

On Thursday, September 27, 2012 4:04:07 AM UTC-5, tousif wrote:
I have read in google docs about memcache eviction policy but i'm frustrated to see some of memcache keys evicted every time within a day. Where as i have given four days (time to live).   I'm using free account now, wanted to confirm before starting billing will it evict keys within a day.  For me it is too expensive to get data to restored as i do offline processing and load to memcache.

Jeff Schnitzer

unread,
Sep 27, 2012, 4:24:48 PM9/27/12
to google-a...@googlegroups.com
On Thu, Sep 27, 2012 at 7:21 AM, Vinny P <vinn...@gmail.com> wrote:
> There are no guarantees with Memcache. Memcache can evict values whenever it
> wants to (mostly due to space pressures, but other reasons can cause
> Memcache to drop values as well). If you want Memcache to retain a value,
> you need to repeatedly access it; this hints to Memcache that this value is
> important and needs to be retained.

...and even if you do this, it will still be reset periodically.
Memcache is for cache, not for storage.

> If you want long-term storage, you need to store to the datastore, Cloud
> SQL, Cloud Storage, etc.

This is the right solution.

Jeff
Reply all
Reply to author
Forward
0 new messages