dial unix /var/run/redis/redis.sock: connect: resource temporarily unavailable

34 views
Skip to first unread message

Abhijit Desai

unread,
Apr 6, 2017, 5:48:31 AM4/6/17
to Redis DB
Please help

Invoking Redis using "gopkg.in/redis.v4" library

Application works fine for single request but it returns "dial unix /var/run/redis/redis.sock: connect: resource temporarily unavailable" when try to use wrk under load -t50 -c50 -d10s 

trying to get the key using 

value, exp = redisClient.Get(key).Result()

below is use to create a pool

redisClient = redis.NewClient(&redis.Options{
Dialer: func() (net.Conn, error) {
return net.DialTimeout("unix", "/var/run/redis/redis.sock", 1*time.Second)
},
//Addr: "10.10.1.150",
Password: "",
DB: 0,
PoolSize: 99000,
})

Thanks in advance

Rgds,

Abhi

hva...@gmail.com

unread,
Apr 6, 2017, 1:13:33 PM4/6/17
to Redis DB
Sounds like your library locks accesses to a device (in this case a socket file) when it's opened via Net.DialTimeout(), so it's preventing more than one process/thread from opening the file.  Perhaps a non-locking call would be better?  Or opening network connections to the Redis server process instead of using the socket file?

Abhijit Desai

unread,
Apr 7, 2017, 8:14:58 AM4/7/17
to Redis DB
Thanks for the reply

Let me try

Rgds,

Abhi
Reply all
Reply to author
Forward
0 new messages