jbholden / cdcpool_google

0 stars 1 forks source link

Memcache data lost every 30 minutes #24

Open jbholden opened 9 years ago

jbholden commented 9 years ago

The way the code is currently written, it is highly reliant on the values in the memcache and expects the data to stay there for a long time in order to reduce the number of accesses to the datastore and avoid going over the quota. Keeping data in the memcache also speeds up the overall website.

It was observed that the items in the memcache are dropped after 30 minutes of non-use.

jbholden commented 9 years ago

I tried changing the time parameter when calling memcache.set() to try and keep the data in the memcache longer.

Experiment 1: set time to 0 (stay forever). The items were still dropped after 30 minutes. Experiment 2: set time parameter to 1 week. The items were still dropped after 30 minutes.

jbholden commented 9 years ago

In this attempt to fix the issue, I created a cron job that runs every 20 minutes and accesses all of the keys in the memcache. In effect acts like a refresh and keeps the keys from expiring after 30 minutes. So far this seems to be working.

Details