Redis: connection error 110

Created on 23 May 2017  路  1Comment  路  Source: redis/redis

Hi every one.

We have celery app on python, some time we got error
"ConnectionError: Error 110 connecting to localhost:6379. Connection timed out."

On our system ipv6 disabled, so connect to localhost posible only via ipv4

that is our config
cat /etc/redis/redis.conf |grep -v '^#'| grep -v '^$'
daemonize yes
pidfile /var/run/redis/redis-server.pid
port 6379
tcp-backlog 65536
bind 127.0.0.1
timeout 0
tcp-keepalive 0
loglevel debug
logfile /var/log/redis/redis-server.log
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /var/lib/redis
slave-serve-stale-data yes
slave-read-only yes
repl-disable-tcp-nodelay no
slave-priority 100
maxclients 100000
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes

in log file we don't see any error or warning about connection or max open files limit, who can help find us what is problem?

Most helpful comment

I just solved this problem today!

You really should set the timeout to a reasonable seconds, not the default 0.
Both tcp-keepalive should be set, for example 60s is nice.

You can check the detail progress from my blog, Fix Redis 110 'connection timed out' problem

@antirez
I highly suggest change the default timeout to a none zero value. Also this timeout confused the people first using Redis. They may think the timeout stands for connection timeout or execute timeout, and they may think it's ok not set timeout.

So when client crashed for any reason, the redis still hold the idle connection forever. It seems when client create a new connection to redis server when there is still idle connection, it returns '110 connection timed out', is that the point?

>All comments

I just solved this problem today!

You really should set the timeout to a reasonable seconds, not the default 0.
Both tcp-keepalive should be set, for example 60s is nice.

You can check the detail progress from my blog, Fix Redis 110 'connection timed out' problem

@antirez
I highly suggest change the default timeout to a none zero value. Also this timeout confused the people first using Redis. They may think the timeout stands for connection timeout or execute timeout, and they may think it's ok not set timeout.

So when client crashed for any reason, the redis still hold the idle connection forever. It seems when client create a new connection to redis server when there is still idle connection, it returns '110 connection timed out', is that the point?

Was this page helpful?
0 / 5 - 0 ratings