memcache get_stats(), what do they mean?

15 views
Skip to first unread message

ten_foot_ninja

unread,
Jan 14, 2009, 11:02:12 PM1/14/09
to Google App Engine
The docs say:
misses: Number of cache get requests resulting in a cache miss.
What is a "cache miss" exactly?

As well, I set an expiration time to 3600 and get_stats reports the
oldest accessed item is 19477 seconds old. The exact same code on my
dev server worked as expected.

Marzia Niccolai

unread,
Jan 15, 2009, 12:27:22 PM1/15/09
to google-a...@googlegroups.com
Hi,

A cache miss is when you make a get() call for a key, and the object
is not in the cache, either because it is expired or has been ejected.

I'm not aware of any current issues that would cause memcache items to
stick around after they have expired, so would you mind providing some
information? The code used to set and retrieve the key with which you
have noticed this would be helpful, the key name, and also, the app
id.

-Marzia

Marzia Niccolai

unread,
Jan 20, 2009, 2:24:46 PM1/20/09
to google-a...@googlegroups.com
Hi,

On Google App Engine servers, to prevent wasted work, items are not
evicted from memcache's memory until there is memory pressure (it
shouldn't return expired results, but the item still might be in the
cache, as it seems to be the case here). This is what oldest_item_age
measures:

oldest_item_age: How long in seconds since the oldest item in the
cache was accessed. Effectively, this indicates how long a new item
will survive in the cache without being accessed. This is _not_ the
amount of time that has elapsed since the item was created.

Which is different from expiration time for an item. This stat is
mostly useful when oldest_item_age is less than your highest
expiration, telling you that you are under memory pressure.

The dev_appserver's memcache implementation inevitably differs under
the covers, so the stats there are not as useful, hence the difference
in the measurements.

-Marzia
Reply all
Reply to author
Forward
0 new messages