On Fri, Aug 19, 2011 at 10:46 AM, Fred Sauer <[email protected]> wrote:
> > > On Fri, Aug 19, 2011 at 1:38 AM, Stephen <[email protected]> wrote: > >> >> >> On Thu, Aug 18, 2011 at 10:58 PM, thstart <[email protected]> wrote: >> >>> >>> I think Master/Slave is a lot faster in my case up to 10 times faster. I >>> tested it with only read, no write operations, >>> no transactions, nothing special for example I have a heavy use of this >>> expression: >>> >>> e = MyList.get_profile(email) >>> my_keys = e.my_keys >>> my_members = db.get(my_keys) >>> >>> for member in my_members: >>> member.<property>, etc. <-- do something with the >>> property >>> >> >> Try this: >> >> e = MyList.get_profile(email) >> my_keys = e.my_keys >> my_members = db.get(my_keys, config=db.create_config( >> read_policy=db.EVENTUAL_CONSISTENCY)) >> > > If you don't want to give you eventual consistency, try this: > > my_members = db.get(my_keys, > config=db.create_config(max_entity_groups_per_rpc=1)) > Also, for reference, here's what this does: @ConfigOption def max_entity_groups_per_rpc(value): """The maximum number of entity groups that can be represented in one rpc. For a non-transactional operation that involves more entity groups than the maximum, the operation will be performed by executing multiple, asynchronous rpcs to the datastore, each of which has no more entity groups represented than the maximum. So, if a put() operation has 8 entity groups and the maximum is 3, we will send 3 rpcs, 2 with 3 entity groups and 1 with 2 entity groups. This is a performance optimization - in many cases multiple, small, concurrent rpcs will finish faster than a single large rpc. The optimal value for this property will be application-specific, so experimentation is encouraged. """ > > > Similarly, in Java you can set max entity groups per RPC: > - Set the appengine.datastore.defaultMaxEntityGroupsPerRpc system property > to 1 > - Use > http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreServiceConfig.html#maxEntityGroupsPerRpc(int) > > > > >> >> for member in my_members: >> member.<property>, etc. <-- do something with the >> property >> >> >> It's a relatively new option: >> >> >> http://code.google.com/intl/en/appengine/docs/python/datastore/functions.html#create_config >> >> -- >> 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. >> > > > > -- > Fred Sauer > Developer Advocate > Google Inc. > 1600 Amphitheatre Parkway > Mountain View, CA 94043 > [email protected] > > > -- Fred Sauer Developer Advocate Google Inc. 1600 Amphitheatre Parkway Mountain View, CA 94043 [email protected] -- 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.
