the same code on another app responds in 14ms


how can this be?

On Oct 13, 2011, at 10:34 AM, andreas schmid wrote:

> hi,
> 
> im having serious speed issues on a site. 
> my app is a python app and im using torndadoweb to serve requests.
> the actual rendered html is also store in the datastore and memcache.
> a decorator on the GET request checks first if there is a memcache entry if 
> it exists it writes the html out, 
> if there is no memcache entry it tries to get it from the datastore and only 
> if that doesnt exist too it executes the handler.
> 
> what i noticed is that the simple get from the memcache until the page 
> displays on the browser takes way too long and i actually dont understand how 
> this is possible.
> 
> here is my stats result:
> <Screen shot 2011-10-13 at 10.22.38 AM.png>
> 
> what is actually taking 6seconds here????
> 
> my decorator looks like this:
> 
> def cache_page(with_keywords=False, keywords=None):
>    def decorator(method):
>        def wrapper(self, *args, **kwargs):
>            uri = self.request.uri.strip()
>            cachekey = '%s|%s' %(appversion, uri)
>            cached = memcache.get(cachekey, 
> namespace='cachedpage|%s'%appversion)
>            if cached:
>                self.write(cached)
>                return
>            page = CachedObject.all(keys_only=True).filter('appversion =', 
> appversion) \
>                                                   .filter('uri =', uri).get()
> 
>            if page:
>                p = db.get(str(page))
>                self.write(p.html)
>                memcache.set(cachekey, p.html, 
> namespace='cachedpage|%s'%appversion)
>                return
>            else:
>               ...
>            return method(self, *args, **kwargs)
>        return wrapper
>    return decorator
> 
> 
> this shouldnt take that long right? 
> any thoughts?
> 
> thank you

<<inline: Screen shot 2011-10-13 at 11.36.17 AM.png>>

-- 
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