ZiglioUK
ZiglioUK

Reputation: 2610

Can you tweak GAE's memcache timeout?

we're experiencing repetitive memcache errors. I see a "LogAndContinueErrorHandler" so requests don't fail but they take an awful amount of time to be fullfilled. Is there any way to force a maximum response time for memcache (something like 50ms?).

com.google.appengine.api.memcache.LogAndContinueErrorHandler handleServiceError: Service error in memcache com.google.appengine.api.memcache.MemcacheServiceException: Memcache getIdentifiables: exception getting multiple keys at com.google.appengine.api.memcache.MemcacheServiceApiHelper$RpcResponseHandler.handleApiProxyException(MemcacheServiceApiHelper.java:76) at com.google.appengine.api.memcache.MemcacheServiceApiHelper$1.absorbParentException(MemcacheServiceApiHelper.java:120) at com.google.appengine.api.utils.FutureWrapper.handleParentException(FutureWrapper.java:53) at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:92) at com.google.appengine.api.memcache.MemcacheServiceImpl.quietGet(MemcacheServiceImpl.java:28) at com.google.appengine.api.memcache.MemcacheServiceImpl.getIdentifiables(MemcacheServiceImpl.java:61) at com.googlecode.objectify.cache.EntityMemcache.getAll(EntityMemcache.java:215) at com.googlecode.objectify.cache.CachingAsyncDatastoreService.get(CachingAsyncDatastoreService.java:253) at com.googlecode.objectify.cache.CachingAsyncDatastoreService.get(CachingAsyncDatastoreService.java:216) at com.googlecode.objectify.cache.CachingDatastoreService.get(CachingDatastoreService.java:137) at siena.gae.GaePersistenceManager.get(GaePersistenceManager.java:2146) at siena.core.batch.BaseBatch.get(BaseBatch.java:60)

Upvotes: 1

Views: 1403

Answers (1)

proppy
proppy

Reputation: 10504

There is an easy way to do that in Python by setting the deadline parameter of the create_rpc method.

For Java is less straightforward, because MemcacheService don't allow you to set an ApiConfig.

This article shows you how to install API hook for the API package.

After that you should be able to override the deadline for the current API call by setting com.google.apphosting.api.ApiProxy.api_deadline_key environment variable like the SDK does in ApiProxy.java

Don't forget to restore it to it's previous value once the RPC call is fired.

Upvotes: 2

Related Questions