On Thu, Apr 16, 2009 at 4:16 AM, DarkCoiote <darkcoi...@gmail.com> wrote:

>
> On Apr 15, 3:26 pm, "Jeff S (Google)" <j...@google.com> wrote:
> > Hi Ray,
> >
> > Which operation was is that timed out (get, query, put)? Also, how
> > consistently are you seeing these timeouts?
> >
> > I generally recommend catching datastore timeouts and handling them in a
> way
> > that makes sense for your app. There are currently occasional (quite rare
> as
> > a percentage) timeouts for queries and gets, and timeouts
>
> > on a put is often
> > an indicator of contention on that entity or entity group.
>
> well... almost (if not all) of the timeouts I'm seeing are on 'put'
> operations...
> but contention would need, like, 2 or more operations on the same
> entity
>  (all my entities are roots... stupid, I know ), right?


Actually, making most of your entities roots is often better than deep
ancestor trees in terms of overall write throughput. In a transactional
write a entity is updated which has a parent entity, the ancestors are
locked. So if nearly concurrent requests update different entities which all
share a common ancestor (in other words the entities are in the same entity
group), some of the child entity updates could fail due to contention on
writes. There are more details here in the documentation:

http://code.google.com/appengine/docs/python/datastore/keysandentitygroups.html#Entity_Groups_Ancestors_and_Paths

"""
Tips for using entity groups:

- Only use entity groups when they are needed for transactions. For other
relationships between entities, use ReferenceProperty properties and Key
values, which can be used in queries.

- The more entity groups your application has—that is, the more root
entities there are—the more efficiently the datastore can distribute the
entity groups across datastore nodes. Better distribution improves the
performance of creating and updating data. Also, multiple users attempting
to update entities in the same entity group at the same time will cause some
users to retry their transactions, possibly causing some to fail to commit
changes. Do not put all of the application's entities under one root.

- A good rule of thumb for entity groups is that they should be about the
size of a single user's worth of data or smaller.

- Entity groups do not have a significant impact on the speed of queries.
"""

If your entities are roots, then yes contention could occur if the same
entity were updated by overlapping requests.

Thank you,

Jeff


>
>
> I'll check for bugs that could cause multiples requests and stuff like
> that....
>
> Thank you
>
> >
> > Happy coding,
> >
> > Jeff
> >
> > On Mon, Apr 13, 2009 at 4:11 PM, DarkCoiote <darkcoi...@gmail.com>
> wrote:
> >
> > > Looks like my and others problem... posted a few days ago:
> >
> > >http://groups.google.com/group/google-appengine/browse_thread/thread/.
> ..
> >
> > > Random datastore timeouts in totally unexpected places...
> >
> > > On Apr 13, 2:36 pm, Ray Malone <rayish...@gmail.com> wrote:
> > > > I'm not sure why this occurs all of a sudden.  The same job runs in
> > > > 600ms.    Then once in a while this runs over 6800 MS and times out.
> > > > I can't have jobs just timeout for no reason.    According to my logs
> > > > during this time the only other request was a second prior.  This
> > > > occurred at 04-13 09:13AM 29.627 today and other times at random in
> > > > the last few days.
> >
>

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

Reply via email to