diff options
author | Marcelo Ricardo Leitner <mleitner@redhat.com> | 2015-02-23 13:02:34 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2015-02-24 23:46:35 -0500 |
commit | d752c364571743d696c2a54a449ce77550c35ac5 (patch) | |
tree | 160b607482c080c720f27626fa7a7130307cbbf3 /include/net | |
parent | 7f73b9f1ca7334eec0ff9a40e37ece92dd3e420f (diff) |
ipvs: allow rescheduling of new connections when port reuse is detected
Currently, when TCP/SCTP port reusing happens, IPVS will find the old
entry and use it for the new one, behaving like a forced persistence.
But if you consider a cluster with a heavy load of small connections,
such reuse will happen often and may lead to a not optimal load
balancing and might prevent a new node from getting a fair load.
This patch introduces a new sysctl, conn_reuse_mode, that allows
controlling how to proceed when port reuse is detected. The default
value will allow rescheduling of new connections only if the old entry
was in TIME_WAIT state for TCP or CLOSED for SCTP.
Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip_vs.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index a627fe690c19..20fd23398537 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -941,6 +941,7 @@ struct netns_ipvs { | |||
941 | int sysctl_nat_icmp_send; | 941 | int sysctl_nat_icmp_send; |
942 | int sysctl_pmtu_disc; | 942 | int sysctl_pmtu_disc; |
943 | int sysctl_backup_only; | 943 | int sysctl_backup_only; |
944 | int sysctl_conn_reuse_mode; | ||
944 | 945 | ||
945 | /* ip_vs_lblc */ | 946 | /* ip_vs_lblc */ |
946 | int sysctl_lblc_expiration; | 947 | int sysctl_lblc_expiration; |
@@ -1059,6 +1060,11 @@ static inline int sysctl_backup_only(struct netns_ipvs *ipvs) | |||
1059 | ipvs->sysctl_backup_only; | 1060 | ipvs->sysctl_backup_only; |
1060 | } | 1061 | } |
1061 | 1062 | ||
1063 | static inline int sysctl_conn_reuse_mode(struct netns_ipvs *ipvs) | ||
1064 | { | ||
1065 | return ipvs->sysctl_conn_reuse_mode; | ||
1066 | } | ||
1067 | |||
1062 | #else | 1068 | #else |
1063 | 1069 | ||
1064 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) | 1070 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) |
@@ -1126,6 +1132,11 @@ static inline int sysctl_backup_only(struct netns_ipvs *ipvs) | |||
1126 | return 0; | 1132 | return 0; |
1127 | } | 1133 | } |
1128 | 1134 | ||
1135 | static inline int sysctl_conn_reuse_mode(struct netns_ipvs *ipvs) | ||
1136 | { | ||
1137 | return 1; | ||
1138 | } | ||
1139 | |||
1129 | #endif | 1140 | #endif |
1130 | 1141 | ||
1131 | /* IPVS core functions | 1142 | /* IPVS core functions |