LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[Patch] Expire Quiescent Template

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Patch] Expire Quiescent Template
From: Horms <horms@xxxxxxxxxxxx>
Date: Mon, 23 Feb 2004 16:06:33 +0900
This patch adds a proc entry to tell LVS to expire persistance templates
for quiescent server. As per the documentation patch below:
 
expire_quiescent_template - BOOLEAN
        0 - disabled (default)
        not 0 - enabled
 
        When set to a non-zero value, the load balancer will expire
        persistant templates when the destination server is quiescent. This
        may be useful, when a user makes a destination server quiescent by
        setting its weight to 0 and it is desired that subsequent otherwise
        persistant connections are sent to a different destination server.
        By default new persistant connections are allowed to quiescent
        destination servers.
 
        If this feature is enabled, the load balancer will expire the
        persistance template if it is to be used to schedule a
        new connection and the destination server is quiescent.

-- 
Horms


diff -ruN linux-2.4/net/ipv4/ipvs/ip_vs_conn.c.orig 
linux-2.4/net/ipv4/ipvs/ip_vs_conn.c
--- linux-2.4/net/ipv4/ipvs.orig/ip_vs_conn.c   2004-01-30 11:18:39.000000000 
+0900
+++ linux-2.4/net/ipv4/ipvs/ip_vs_conn.c        2004-02-05 17:09:28.000000000 
+0900
@@ -1130,7 +1130,9 @@
         * Checking the dest server status.
         */
        if ((dest == NULL) ||
-           !(dest->flags & IP_VS_DEST_F_AVAILABLE)) {
+           !(dest->flags & IP_VS_DEST_F_AVAILABLE) || 
+           (sysctl_ip_vs_expire_quiescent_template && 
+            (atomic_read(&dest->weight) == 0))) {
                IP_VS_DBG(9, "check_template: dest not available for "
                          "protocol %s s:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d "
                          "-> d:%u.%u.%u.%u:%d\n",
diff -ruN linux-2.4/net/ipv4/ipvs/ip_vs_ctl.c.orig 
linux-2.4/net/ipv4/ipvs/ip_vs_ctl.c
--- linux-2.4/net/ipv4/ipvs.orig/ip_vs_ctl.c    2003-11-29 03:26:21.000000000 
+0900
+++ linux-2.4/net/ipv4/ipvs/ip_vs_ctl.c 2004-02-05 17:07:17.000000000 +0900
@@ -79,6 +79,7 @@
 int sysctl_ip_vs_expire_nodest_conn = 0;
 int sysctl_ip_vs_sync_threshold = 3;
 int sysctl_ip_vs_nat_icmp_send = 0;
+int sysctl_ip_vs_expire_quiescent_template = 0;
 
 #ifdef CONFIG_IP_VS_DEBUG
 static int sysctl_ip_vs_debug_level = 0;
@@ -1436,6 +1437,9 @@
         {NET_IPV4_VS_NAT_ICMP_SEND, "nat_icmp_send",
          &sysctl_ip_vs_nat_icmp_send, sizeof(int), 0644, NULL,
          &proc_dointvec},
+        {NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE, "expire_quiescent_template",
+         &sysctl_ip_vs_expire_quiescent_template, sizeof(int), 0644, NULL,
+         &proc_dointvec},
         {0}},
        {{NET_IPV4_VS, "vs", NULL, 0, 0555, ipv4_vs_table.vs_vars},
         {0}},
--- linux-2.4/include/net/ip_vs.h.orig  2003-11-29 03:26:21.000000000 +0900
+++ linux-2.4/include/net/ip_vs.h       2004-02-18 20:50:16.000000000 +0900
@@ -317,6 +317,7 @@
        NET_IPV4_VS_EXPIRE_NODEST_CONN=23,
        NET_IPV4_VS_SYNC_THRESHOLD=24,
        NET_IPV4_VS_NAT_ICMP_SEND=25,
+       NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE=26,
        NET_IPV4_VS_LAST
 };
 
@@ -702,6 +703,7 @@
 extern int sysctl_ip_vs_expire_nodest_conn;
 extern int sysctl_ip_vs_sync_threshold;
 extern int sysctl_ip_vs_nat_icmp_send;
+extern int sysctl_ip_vs_expire_quiescent_template;
 extern struct ip_vs_stats ip_vs_stats;
 
 extern struct ip_vs_service *ip_vs_service_get(__u32 fwmark,


--- /tmp/sysctl.html    2002-09-16 10:14:37.000000000 +0900
+++ sysctl.html 2004-02-05 17:21:24.000000000 +0900
@@ -45,6 +45,22 @@
        equivalent to the feature some people requires to flush
        connections when its destination is not available.
 
+expire_quiescent_template - BOOLEAN
+       0 - disabled (default)
+       not 0 - enabled
+
+       When set to a non-zero value, the load balancer will expire
+       persistant templates when the destination server is quiescent. This
+       may be useful, when a user makes a destination server quiescent by
+       setting its weight to 0 and it is desired that subsequent otherwise
+       persistant connections are sent to a different destination server.
+       By default new persistant connections are allowed to quiescent
+       destination servers.
+
+       If this feature is enabled, the load balancer will expire the
+       persistance template if it is to be used to schedule a
+       new connection and the destination server is quiescent.
+
 nat_icmp_send - BOOLEAN
        0 - disabled (default)
        not 0 - enabled
<Prev in Thread] Current Thread [Next in Thread>
  • [Patch] Expire Quiescent Template, Horms <=