Hi,

It sounds like you're accounting for CPU megacycles, but not API CPU
megacycles. You also need to call quota.get_request_api_cpu_usage().

-Nick Johnson

On Tue, Aug 17, 2010 at 7:38 AM, MyElasticEye <sarp.er...@gmail.com> wrote:

> Hi,
>
> I have been trying to optimize the App Engine application my team is
> working on. As I read on Google's documentation,
>
> 1 megacycles = 1/1200 cpu seconds
>
> And if I a check how many megacycles it takes to load an empty sinlge
> page without any templates using webapp.py, it takes 0 megacycles.
> However, the amount of cpu miliseconds used for the request usually
> becomes around 200 ms. That's understandable because of the overheads
> of the request.
>
> However, I see that when I do like:
>
> class SomePage(..):
> def get(self):
>        start = quota.get_request_cpu_usage()
>        # do some dense operations here...
>        end = quota.get_request_cpu_usage()
>        logging.info("the operation cost %d megacycles." % (start -
> end))
>        return
>
> I can't see a relation btw the megacycles it takes and the cpu
> miliseconds used. According to the equation above, 1200 megacycles = 1
> cpu second, and if the result of the operation is 2400 megacycles, it
> means that it should equal to 2 cpu seconds. Let's say there is an
> overhead occuring even if we load an empty page or whatever, and then
> it should equal to 2400 + 200 = 2600 ms
>
> However, the logs of the request says that it takes much more than 2
> cpu secs, more like 7000 or 9000 cpu milisecs.
>
> Why is this occuring?
>
> Thanks
>
> --
> 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-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com<google-appengine%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>


-- 
Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. ::
Registered in Dublin, Ireland, Registration Number: 368047
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047

-- 
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-appeng...@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