memcache evictions

44 views
Skip to first unread message

burg

unread,
Dec 11, 2010, 2:23:50 PM12/11/10
to Google App Engine
Hi everybody,
I'm building a new app and have been working hard to make most of the
requests use cache only - using both HTML cache and Model cache.
All my objects are cached for the max period - 1 month (2591999
seconds - just in case)

However I've noticed that my caches are constantly evicted (this has
been the behavior for ~2months now)
I have tried remote shelling and using memcache.get_stats() to log the
events in 1 minute intervals, and I noticed exactly how almost every
few minutes, a cache object is evicted. For example (once again - each
line represent a 1 minute interval):
{'hits': 166680L, 'items': 130L, 'bytes': 2574429L, 'oldest_item_age':
5020L, 'misses': 40898L, 'byte_hits': 4181093687L}
{'hits': 166680L, 'items': 130L, 'bytes': 2574429L, 'oldest_item_age':
5081L, 'misses': 40898L, 'byte_hits': 4181093687L}
{'hits': 166685L, 'items': 129L, 'bytes': 2560942L, 'oldest_item_age':
5142L, 'misses': 40899L, 'byte_hits': 4181177009L}
{'hits': 166685L, 'items': 128L, 'bytes': 2550852L, 'oldest_item_age':
5204L, 'misses': 40899L, 'byte_hits': 4181177009L}
{'hits': 166688L, 'items': 127L, 'bytes': 2550037L, 'oldest_item_age':
5265L, 'misses': 40900L, 'byte_hits': 4181222514L}
{'hits': 166688L, 'items': 127L, 'bytes': 2550037L, 'oldest_item_age':
5327L, 'misses': 40900L, 'byte_hits': 4181222514L}
{'hits': 166691L, 'items': 127L, 'bytes': 2550043L, 'oldest_item_age':
5388L, 'misses': 40901L, 'byte_hits': 4181268013L}
{'hits': 166691L, 'items': 127L, 'bytes': 2550043L, 'oldest_item_age':
5450L, 'misses': 40901L, 'byte_hits': 4181268013L}
{'hits': 166694L, 'items': 125L, 'bytes': 2502372L, 'oldest_item_age':
5511L, 'misses': 40902L, 'byte_hits': 4181313518L}
{'hits': 166694L, 'items': 125L, 'bytes': 2502372L, 'oldest_item_age':
5573L, 'misses': 40902L, 'byte_hits': 4181313518L}

Throughout few days I've noticed that 'oldest_item_age' would never
pass 3 hours threshold (10K seconds)

Could anybody help here please?

Tim Hoffman

unread,
Dec 12, 2010, 3:30:20 AM12/12/10
to google-a...@googlegroups.com
HI

I am afraid there is nothing to help with.  Its a part of the behaviour of the system that data 
will be evicted from memcache. You absolutely cannot rely on things being kept around in memcache.

And your stats actually look pretty good, you have a 3% cache miss rate.

Rgds

Tim

burg

unread,
Dec 12, 2010, 4:10:50 AM12/12/10
to Google App Engine
From What I calculated, the miss ration is 20% (40902/(166694+40902))
and that's a lot considering that I cache everything and there are
very little entities.

Also my caching API calls do not even scrape the beginning of the
quota....
Will AppEngine For Business help here?

Tim Hoffman

unread,
Dec 13, 2010, 11:32:00 AM12/13/10
to google-a...@googlegroups.com
Oops.  My bad, must have missed or added a digit ;-(

We have a pretty large and fairly static site and am only getting a 40% hit ratio with about 8MB in cache.  Still quite happy with it though.

T
Reply all
Reply to author
Forward
0 new messages