Your stats don't seem to out of line (especially considering that you are
doing 4 to 6 individual puts inside of a transaction).

Batch those puts.. that should help some.  If it doesn't help enough, look
into using memcache for the objects that you're getting (and make sure to
update the memcache values any time those objects are updated in the
datastore from other parts of your code).

If that still doesn't help, look into ways of doing the put without a
transaction.

Here's an example from my app (written in Python):

3 Urlfetch.Fetch() calls
1 datastore_v3.Put()  # this is a batch of 4 entities of one Model type and
1entity of a different Model type.
1 memcache.set()  # this is a set_multi() for the 4 similar entities from
the put.
1 taskque.add()

A hot instance of that uses up this cpu time:

446ms 485cpu_ms 408api_cpu_ms

I haven't done the fine grained logging of cpu time in a looong time.. but
my guess is that a lot of the cpu_ms is gobbled up by the 3 Urlfetch.Fetch()
calls. (sure wish appstats had a way to tell me what the cpu_ms was for each
call).

Anyway, the median db.Put() time on GAE (without a transaction) is around
90ms for one small entity.  AND... I bet a lot of that time (and api_cpu_ms
time) gets used up issuing the RPC stuff.. "hey here comes my put!", "hey
your put worked" etc.. so batching 5 puts together into 1 should have a big
impact (maybe even more of an impact in a transaction?).

If you can, report back what sort of performance change you get by doing a
batch put inside a transaction.. I'm interested to know.

On Thu, Sep 30, 2010 at 11:33 AM, Michael <[email protected]> wrote:

> Thanks for the suggestions.  We are doing our gets in batches.  We'll also
> look at our memcache options and whether the transaction is costly.  I'll
> report back if I see any significant improvements.
>
> You may still not have enough information about our usage to answer this
> question, but given the above data, do our CPU times appear high for the
> work being done?
>
> --
> 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]<google-appengine%[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.

Reply via email to