Thanks John.  I did do that, but after reading the documentation, it
seems that if you query for 10 objects with "|| key=='abc' ||
key=='def' || key=='ghi'", then it'll actually perform 10 queries
under the hood.

I'm noticing a lot of slow-down in my app from these GAE exceptions
that I think are due to my app starting up in new JVMs.  That might be
part of the problem.  The other part is that my entities were a little
screwy.  I flattened the children into the parent since there's always
three children, and each child only has a couple properties.  That
helped.

After that, I implemented caching, which makes it scream now.  I'm
caching the display DTOs rather than the entities, because just
building the DTOs was taking about 250 cpu ms.

So, with *nothing* in cache, my original takes 2 cpu seconds, 1 api
second. With the supporting entities in cache, it comes down to 800ms/
500ms.  After cleaning up my query and the entities as mentioned
above, I brought that down to 500ms/200.  And then, after caching the
objects I'm querying for here, I'm down to 50-90 cpu ms with no API
ms.

Okay, as I was finishing this post, I hit the app a few more times...
It's funny/frustrating how sporadic the system is.  Sometimes the
optimized path still takes up to 7 seconds, just to pull from
cache!!!  A few more refreshes and it's back down to 55 cpu ms and no
api ms.

Oh well, I guess this is just the nature of the beast.  Some users are
going to have pages take a few seconds to load at times, but at least
I know that if I had to scale this up, it would still work, right? :)

On Feb 19, 1:36 pm, John Patterson <jdpatter...@gmail.com> wrote:
> You could try to batch the get of your "ObjectBeingFollowed" entities  
> so you only do two gets.  Is most of your cpu time api_cpu?
>
> On 19 Feb 2010, at 12:29, Blake wrote:
>
>
>
> > I'm relatively new to GAE.  My queries so far have for single entities
> > with owned relationships, queried by key, which has been great - no
> > orange or red screaming in my logs.  More recently, I've been working
> > on a simple page that does this:
>
> > 1. get a list of 10 of the user's "Following" entities - each contain
> > a key to an object the user is following, and some extra metadata
> > about the relationship
>
> > 2. get each of the "ObjectBeingFollowed" entities by key in the
> > "Following" entity
>
> > Easy enough to get working, but the logs are screaming at me with CPU
> > times up around 0.5-1.0 seconds.  Is this just what to expect?  Do you
> > guys have pages that always return red or orange log messages?
>
> > Thanks!
>
> > --
> > You received this message because you are subscribed to the Google  
> > Groups "Google App Engine for Java" group.
> > To post to this group, send email to google-appengine-java@googlegroups.com
> > .
> > To unsubscribe from this group, send email to 
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=en
> > .

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to