Memcache timeout?

40 views
Skip to first unread message

Ivo Bellin Salarin

unread,
May 3, 2017, 4:05:55 AM5/3/17
to Google App Engine
Hi everybody,

Would it be possible to set a timeout on memcache calls?

AFAIK, the http implementation (appengine_rpc_httplib2.py) exposes a Send(..., timeout=None) which is actually NOT binded to the memcache/__init__.py deadline. Thus, the deadline is not taken into account.

Our need is to set a timeout on memcache calls which, sometimes seem to become unresponsive. We prefer to get a memcache exception rather than an undefined wait...

Thanks in advance,
Ivo BS

Nicholas (Google Cloud Support)

unread,
May 3, 2017, 3:50:28 PM5/3/17
to Google App Engine
As far as I am aware, there is no built in timeout feature for memcache calls.  You might be able to implement yourself however, by using the async versions of the calls and waiting a given time limit before moving forward with a plan B.  You could ignore the result if it returns after the given time frame.

If you would like to see this sort of timeout feature built in to the library, I'd recommend filing a feature request on the Issue Tracker.  Be provide to provide a use case to explain how this feature would be beneficial.

Regarding the memcache calls hanging, I do not believe this to be the intended behavior of the service.  I have not been able to find any documentation supporting the possibility that the call may hang indefinitely.  As such, I would also recommend filing an issue for this as well.  When doing so, be sure to include the following:
  • How often memcache calls are hanging
  • Any Stackdriver Trace data that these hanging calls may reveal
  • Whether you are using shared or dedicated memcache
  • Approximate volume of memcache storage when such errors occur
  • Are these hanging errors limited to periods of high traffic, low traffic or happens frequently during both?
Reply all
Reply to author
Forward
0 new messages