This is an excellent suggestion. I'm also doing whatever I can in my power to limit myself to a single instance (besides of course just fixing MaxNumInstances parameter to 1). And this technique goes a long way to reduce latencies, and data store reads, while keeping only one instance around.
On Thu, Sep 8, 2011 at 2:01 PM, Santiago Lema <[email protected]>wrote: > I recently complained that the new pricing forced me to take down my > own stats site. Also I noted that my minimalist app used to serve > horoscopes to my iPhone app went from about 9 $ to about 177$ per > month. > > Since this app basically serves semi-static content (it's updated once > a day) I used AppEngine's memcache to serve every request. It turns > out that memcache in AppEngine has a confusing name. Due to it being > consistent across all instances is a much more slower beast than > actual memory cache. It might be free now but it hugely slows downs > your requests. If memcache gets slow to respond AppEngine will spawn > more instances. > > So I just added another level of caching before memcache: a simple > python dict that stores the data in the instance itself. This > instantly reduced the number of instances back to 1 (sometimes 2). > This suddenly makes the new pricing acceptable. > > Of course this kind of optimization won't work for all cases but it > works beautifully when the data doesn't have to be modified in the > cache and cannot be different on various instances. > > -- > 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.
