Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Increase connection timeouts for Redis
Browse files Browse the repository at this point in the history
When using py-redis for connecting to Redis via HAProxy the connection
is being closed even when alive by HAProxy. Unfortunately this is a know
issue on py-redis side (see [1]). This patch increases connection timeouts
to not pollute (for example) Gnocchi [2] logs with reconnect tracebacks every
2 minutes.

[1] redis/redis-py#1140
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1924373

Change-Id: Ie7ee7c90107cfe5bff08f5c778a6273ae9ffcc76
  • Loading branch information
paramite committed Jan 26, 2022
1 parent 1916e80 commit 209e954
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions manifests/haproxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -1618,25 +1618,29 @@
bind => $redis_bind_opts,
collect_exported => false,
options => {
'timeout client' => '90m',
'default_backend' => 'redis_be',
'option' => [ 'tcplog' ],
},
}
haproxy::backend { 'redis_be':
options => {
'balance' => 'first',
'option' => [ 'tcp-check' ],
'tcp-check' => $redis_tcp_check_options,
'timeout server' => '90m',
'balance' => 'first',
'option' => [ 'tcp-check' ],
'tcp-check' => $redis_tcp_check_options,
},
}
$redis_service = 'redis_be'
} else {
haproxy::listen { 'redis':
bind => $redis_bind_opts,
options => {
'balance' => 'first',
'option' => [ 'tcp-check', 'tcplog' ],
'tcp-check' => $redis_tcp_check_options,
'balance' => 'first',
'timeout client' => '90m',
'timeout server' => '90m',
'option' => [ 'tcp-check', 'tcplog' ],
'tcp-check' => $redis_tcp_check_options,
},
collect_exported => false,
}
Expand Down

0 comments on commit 209e954

Please sign in to comment.