Dedicated memcache keeps flushing

58 views
Skip to first unread message

Vinay Chitlangia

unread,
Oct 7, 2016, 11:30:44 PM10/7/16
to Google App Engine
We are using dedicated memcache in our application. Curiously the oldest cached key time is almost always 1-2 days.
The dedicated quota is 1GB and the cache size never crosses 500MB.

Entries are made to memcache with 365 days expiration time.

Wondering if this is expected that the cache will keep purging data on a 1-2 day scale.

Jordan (Cloud Platform Support)

unread,
Oct 12, 2016, 5:01:52 PM10/12/16
to Google App Engine
As Memcache is not persistent long-term storage, keys are not expected to live long and can be evicted for reason explained in our documentation. As noted, even Dedicated Memcache follows the LRU eviction policy. This means that pushing the limit of your set dedicated Memcache size will begin to evict the oldest keys. You can increase the size of your dedicated Memcache by clicking the 'Change' button in your Console to alleviated this pressure.

Specifically with Dedicated Memcache, it is your app's behavior that will evict its own keys. If you write to the same objects or keys, you will in turn evict the previous item you are overwriting to make room for the new change. The same is also true for deleting keys, as they will also be evicted. Apps that overload their task(s) will end up hurting itself as well. I highly recommend you abide by the Ops/Sec/GB limit shown in your Console for your set Memcache size as explained in our documentation. This will ensure that you are optimizing your interactions and operations to make the most out of the space you are allotted. 

If after performing the above recommendations, you are still seeing this set eviction date of 2 days, I ask that you provide more information about your usage of Memcahce, and your business need to have items stored for 365 days. Providing code samples of your interactions will also help in my investigations. 
Reply all
Reply to author
Forward
0 new messages