redis tcp-backlog
Clients cannot connect to redis instance if redis instance is blocking due to AOF and at the same time configed with small tcp-backlog compare to incoming connections.
with ‘/proc/sys/net/ipv4/tcp_abort_on_overflow’ == 1, server will not send sync/ack back to client immediately, which leads to client side timeout.
if accept queue is full, client sync will be dropped.
Here’s how to reproduce this:
- setup redis server with tcp-backlog of 1.
- connect to it wit redisson client
below is the screen shot of wireshark:
this is the exception redisson thrown:
reference:
- http://veithen.io/2014/01/01/how-tcp-backlog-works-in-linux.html
- http://jm.taobao.org/2017/05/25/525-1/
By the way, when server received ack from client but accept queue is full and if /proc/sys/net/ipv4/tcp_abort_on_overflow == 1, a RST will be sent. Or the ack is ignored and server resend SYNC/ACK to /proc/sys/net/ipv4/tcp_synack_retries the socket after timeout.