Skip to content

Commit

Permalink
Merge pull request #168 from noonedeadpunk/tcp_retries
Browse files Browse the repository at this point in the history
Decrease TCP retries in case of VIP failover
  • Loading branch information
evrardjp committed Mar 1, 2021
2 parents f485562 + 4b3d64f commit 727cb94
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
9 changes: 9 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ keepalived_instances: {}
keepalived_sync_groups: {}
keepalived_bind_on_non_local: False

# In case of VIP failover some applications might stuck on retrying to send
# data without updating ARP. This variable defines amount of retries kernel
# will send before consider connection as dead. It will influence on VIP
# failover speed directly. Default sysctl value is 15 which result in
# ~13 minutes of recovery. 8 retires is minimum according to RFC 1122 and
# results in 100 seconds for timeout. Oracle suggest a value of 3 for a RAC
# configuration which might be too agressive for some scenarios.
keepalived_sysctl_tcp_retries: 8

# This list of strings will appear in the global_defs section of the
# keepalived configuration file.
# Example:
Expand Down
12 changes: 8 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,18 @@

- name: Allow consuming apps to bind on non local addresses
sysctl:
name: "{{ item }}"
value: 1
name: "{{ item.name }}"
value: "{{ item.value }}"
sysctl_set: yes
state: present
when: keepalived_bind_on_non_local | bool
with_items:
- "net.ipv4.ip_nonlocal_bind"
- "net.ipv6.ip_nonlocal_bind"
- name: "net.ipv4.ip_nonlocal_bind"
value: 1
- name: "net.ipv6.ip_nonlocal_bind"
value: 1
- name: "net.ipv4.tcp_retries2"
value: "{{ keepalived_sysctl_tcp_retries }}"
tags:
- keepalived-install

Expand Down

0 comments on commit 727cb94

Please sign in to comment.