0
votes

Under Compute > Memcache we have some statistics:

HitRatio, Items In Cache, Oldest Item Age, Total Cache Size etc.

Then we can also see stats for 20 commonly used keys ordered by either Operation Count or Memcache compute units

my question is, is it possible to figure out how many times per second a key has been read (or read + written) from memcache using just memcache stats?

For example, if i have 1 million hits and the oldest item is 1 day old, and my memecache key uses 5% of the traffic,

Could I go (1 million hits * 5% = 50,000 hits) / 24 hours = 0.57 hits per second.

Really I have no idea what the statistics on the memcache viewer actually mean - For example the statistics don't even reset if memcache is flushed.

Cheers.

1

1 Answers

0
votes

I am pretty sure counting this way won't return what you want. As explained in the python memcache statistic paragraph, the age of your items reset when they are read. So the oldest item being 1 day old just means it has been in memcache for a day since it was read.

To figure out how many times a second a key has been read, you might want to use a sharding counter, or some other form of logging, then retrieving the logged data with the Logs API to interpret them. It can't really be done directly from the memcache statistics (might be an interesting feature to request on Google's Public Issue tracker though)