Memcache doesn't work that way.  You don't get any guaranteed quantity of
cache and it's not guaranteed to last for any specific length of time -
memcache is a shared resource and google allocates it according to their
own magic algorithms.

Data falling out of the cache every 4-5 hours?  That doesn't sound like a
problem to me.  If you have cache data that needs predictable durability,
consider a backend.

Jeff

On Mon, Nov 21, 2011 at 10:59 AM, Deepak Singh <[email protected]>wrote:

> My application while on loading makes a read operation around 6500 rows
> which is fixed for app. I have set memcache for this feature with cache
> expiration to 8 days. Bu i observe that cache usually fails 5 to 6 times in
> day, so in that case my app has datastore read of around 6500 rows. Thus my
> app heavily uses datastore read quota whic is very costly to me.
>
> I have been unable to make cache available for 8 days or even working
> properly.
>
> It would be great if you can let me know how to optmize this cache
> properly.
>
> Thanks
> Deepak
>
>
> On Mon, Nov 21, 2011 at 4:14 AM, Brandon Wirtz <[email protected]>wrote:
>
>> Memcache is just a cache. Your values have no guarantee of being there
>> even
>> 1micro second after you did the write.
>>
>> If you post your code we might be able to help, but I assure you Memcache
>> does work.
>>
>> My app does reads from the datastore or memcache for every request,
>> sometimes to for initialization of variables... like Who am I, Why am I
>> here, what configuration am I in.   And then to serve the request...
>>
>> We use a combination of instance memory and memcache to not have to talk
>> to
>> the data store. Datastore reads are "slow" compared to Instance Memory and
>> Memcache.
>>
>> Datastore Write Operations               0.24 Million Ops        0.19
>> $1.00/ Million Ops       $0.19
>> Datastore Read Operations                0.02 Million Ops        0.00
>> $0.70/ Million Ops       $0.00
>>
>>
>> I didn't count the "reads in my app" to the "writes" but I know I do reads
>> for initialization every time, and reads for data every time.  I only do
>> writes on some requests...   So I am going to be conservative and say
>> that I
>> do 3x as many reads as writes in my code, but so far today I have hit the
>> Datastore with a write 10x as many times as I have a read.  That works out
>> to my local memory and memcache saving me 97% of the time.
>>
>> I don't have an easy way to tell you how much of the time that is instance
>> memory and how many times it is memcache, but I assure you it works.
>>
>>
>>
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of Jamil Rzayev
>> Sent: Sunday, November 20, 2011 1:48 PM
>> To: Google App Engine
>> Subject: [google-appengine] Memcache doesn't work
>>
>> Hi.
>>
>> I have to use memcache to store some values frequently accessible by
>> application I am working on.
>> The Google App Engine Memcache doesn't work as it apparently removes
>> values
>> after a couple of minutes I store it at memcache.
>>
>> I really need any idea and would highly appreciate for any comments.
>> I have already tried to ask here, but got response that I need to store
>> values as soon as I read them and didn't work.
>>
>> I am still losing my values...
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>>
>
>
> --
> Deepak Singh
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>



-- 
I am the 20%

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to