Latency for my application seems to be very high even though I've optimized it significantly.
Here is an appstats sample for one of the requests:
(4) 2013-01-16 08:33:19.750 "GET /" 200 real=3154ms api=0ms overhead=12ms (39 RPCs, cost=0, billed_ops=[])
images.GetUrlBase 18 0
memcache.Get 10 0
datastore_v3.Get 9 0
datastore_v3.RunQuery 1 0
user.CreateLogoutURL 1 0
Seems images.GetUrlBase is one of the main culprit as well as memcache (?). Currently I have blob being fetched and passed to get_serving_url, with variable image sizes throughout the application.
Any recommendation on performance improvements? thanks
figured
out the main problem is in fact the get_serving_url, because its
fetching the blob file and passing in the key each time. any ideas on
caching methods for this particular situation? |
for tries in xrange(1, 4):
try:
url = images.get_serving_url(key)
break
except:
logging.warning(...)
else:
logging.error(...)
--To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/pA887tjIKPgJ.
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-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
def image(self, size=0):
try:
not_found '/images/not_found.jpg'
image_url = memcache.get('some_key:' + self.id + ':' + str(size))
if not image_url:
if self.image:
blob_key = self.image.blob_key
image_url = get_serving_url(blob_key, size)
memcache.set('some_key:' + self.id + ':' + str(size), image_url)
else:
image_url = not_found
except:
image_url = not_found
#logging error
return image_url