Intermittent Error 101 connecting to localhost:6379. Network is unreachable.

144 views
Skip to first unread message

poiuytrez

unread,
Sep 30, 2015, 5:23:06 AM9/30/15
to Redis DB
Hello, 

I have a python/django application which throw sometimes a peak of "Error 101 connecting to localhost:6379. Network is unreachable.". I checked in the redis logs and I do not find anything wrong. Has anyone experienced the same issue? 

Thank you for your help,
poiuytrez

Josiah Carlson

unread,
Oct 1, 2015, 1:52:42 AM10/1/15
to redi...@googlegroups.com
You are running out of outgoing ephemeral ports. You need to use connection pooling. This is easy.

import redis
conn = redis.Redis()
# conn is a connection, as well as a thread *and* fork-safe connection pool. Just
# use it in all your threads, and it will just work.

As an aside, if you are connecting locally, you can tell Redis to also listen on a unix domain socket, and you can pass that to the redis.Redis() constructor instead.

 - Josiah


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages