Note that there are some explanatory texts on larger screens.

plurals
  1. PODedicated memcache items vanishing
    primarykey
    data
    text
    <p>I built an application in PHP on Google App Engine and in order to improve performance began using memcache to cache templates. It works really well as expected however I began seeing that items were disappearing from the shared cache after a few hours.</p> <p>The documentation states that the shared memcache is provided on a best effort basis and items will be expired if memory becomes an issue. To be clear, we are storing about 20 key/value pairs that are each about 10k.</p> <p>So assuming that these items were being expired because it was in a shared memcache, I upgraded to a 1 Gig dedicated memcache for our application.</p> <p>My code is pretty simple and straight forward:</p> <pre><code>$memcached = new Memcached(); $memcached-&gt;set('mykey', 'mydata', 1296000); </code></pre> <p>The above code should be setting that key and data with an expiration of 15 days. GAE docs indicate that the maximum is 30 days.</p> <p>When I run the code it works great and sets the key/data as expected. However when I go to bed and wake up in the morning, what does the memcache viewer in the application admin say?</p> <blockquote> <p>Oldest item age: 1 hour(s) 46 min(s) 25 second(s)</p> </blockquote> <p>What the heck? There is no code that is flushing or deleting, it's a dedicated memcache.</p> <p>What am I doing wrong? It really seems like something is causing the memcache to expire prematurely. This is a very very low volume application so from the time I set this to the time I checked it (according to the logs) there was only 1 visit (approximately 1 hour and 46 minutes ago).</p> <p>When an instance shuts down if it's the last resident instance does it clear the memcache?</p> <p>Thanks for any help you can provide.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload