TimeoutError: Timeout connecting to server

115 views
Skip to first unread message

Pavel Madr

unread,
Jul 10, 2019, 6:01:10 AM7/10/19
to Google Cloud Memorystore Discuss
Hi,

I use Memorystore from Python and get "TimeoutError: Timeout connecting to server" few times a day.

My initial configuration is:

import redis
store = redis.StrictRedis(host=IP, port=PORT, socket_timeout=0.5)

# the following line invokes the error
store.get(my_key)

Memorystore and VM is in the same region.

Should I increase socket_timeout value? 
I'd prefer not to increase the timeout much. I'm afraid that it won't help and the program will be waiting too long. It's the part of time critical code.

Message has been deleted

Josh L.

unread,
Aug 16, 2019, 5:37:37 PM8/16/19
to Google Cloud Memorystore Discuss
Did you ever solve this, Pavel? We're seeing intermittent timeouts to Memorystore from Python GAE Standard via VPC connection as well. 

If your call to Memorystore is primarily just cache data and you can fall back to querying the source system directly (eg. a database, etc), then you could just catch the TimeoutError and proceed with your code.
Reply all
Reply to author
Forward
0 new messages