There is not much going on in the Python code. Based on URL I retrieve a few objects and setup a context for a template. I memcache either objects or keys (assuming that get(key) is as fast as getting an object from memcache). The only extra Python code is to keep track of objects in a dictionary to make sure I have only one copy of every object.
I am using django dispatch loop and noticed that a redirect request alone (too add a /) may take 500 ms. A request that results in all objects or keys coming from memcache (say 10) still can take sometimes 1600ms, which gives me a red warning (I think 1500 is the threshold). I wonder how accurate is the time sampling. On Jan 19, 4:59 pm, djidjadji <[email protected]> wrote: > Sometimes the Datastore takes longer then expected. > You don't have to take action for the CPU used in the Datastore operations. > What you need to optimize is the Python code you write yourself, don't > do heavy math. > If you only do template stuff with the retrieved objects you will not > get entrys in the log about High CPU, Django templates are not CPU > intensive. > High CPU in the dashboard might be a reason to look if you need that > amount of objects and "can I do with less" but it will not count for > the High-CPU-quota. > If you often get log warnings for a certain query, that query needs > optimization. > > 2009/1/19 Roman <[email protected]>: > > > > > I get warnings in my app that some requests used high amount of CPU > > (2000ms, roughly 1 times over CPU limit). > > Those requests require a few queries, e.g.: > > 5 of WHERE a=b type, each returning 1 object > > 1 of WHERE ANCESTOR IS :parent foo ORDER BY bar DESC returning 5 > > objects > > 2 of Model.ref_set type returning 1-5 objects > > and finally a few of get(key) type. > > > The db is very small (less 100 objects). > > > My questions is: is this too much for one request, or am I doing > > something terribly wrong? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
