I have an app (savingeveryweek) that has been in pilot testing for the last several weeks with pretty low usage. I'm making tweaks each day, but starting yesterday I began to commonly see huge CPU and API numbers (often over 10,000) for no apparent reason. This morning, I added logging (quota.get_request_cpu_usage()) to key parts of my webapp.RequestHandler, expecting to find some huge loop that I inadvertently created during one of my mods.
Instead, while I certainly see room for improvement in my code, these huge cpu numbers are happening outside the realm of my loggable code. At the start of __init__(self) I see values in the single digits up to about 6,800. It seems that due to my site's low usage, when a new instance of the app needs to be started, that gets tacked onto the initiating request's cpu time. That's understandable. The real quandary I have is that my last logging happens after the response.out.write() call for the request. My code does nothing else after that. Here are some examples this morning from the GAE log viewer: 03-13 08:52AM 15.031 /shoppinglist 200 6022ms 10805cpu_ms 8919api_cpu_ms (init quota logged: 1937, ending quota logged: 2909) 03-13 08:50AM 16.694 /shoppinglist 200 4973ms 9813cpu_ms 8919api_cpu_ms (init quota logged: 22, ending quota logged: 947) 03-13 08:49AM 47.134 /shoppinglist 200 9397ms 10844cpu_ms 8919api_cpu_ms (init quota logged: 6843, ending quota logged: 8086) (The values in parentheses are those that I logged using quota.get_request_cpu_usage() at the start of __init__ and after the response.out.write().) As you can see, the page has a wide range of values that I'm logging in my code, mostly related to the pre-init time that I've got no control over. But the total time "charged" to the app always is about the same--and much higher than I've ever seen it. Earlier in the week, this same page had cpu_ms and api_cpu_ms times that made sense given the actual run time of the page. Has something changed on the accounting for these logs recently, or are there other techniques I can use to track this down? Jeff -- 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.
