]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
hno squid-2.3.DEVEL2.icp_timeout_selection.patch
authorhno <>
Wed, 3 May 2000 00:47:33 +0000 (00:47 +0000)
committerhno <>
Wed, 3 May 2000 00:47:33 +0000 (00:47 +0000)
Squid-2.3.DEVEL2: ICP timeout selection

This is an attempt to fix the dynamic ICP timeout selection when one is
peering with remote parents and have some close-by siblings with a much
lower ICP rtt. This is done by preferring to calculate the ICP timeout
based on parents only (based on siblings if there is no alive parents)

ChangeLog
src/neighbors.cc

index b0790bd704fdb23847cc854229b0ef31816a3ed6..208c68a4979c57a8a19f2eaad8e50cbf750fdc8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,16 @@ Changes to Squid-2.4.DEVEL3 ():
        - Added --enable-auth-modules=... configure option
        - Improved ICP dead peer detection to also work when the workload
          is low
+       - Improved TCP dead peer detection and recovery
+       - Squid is now a bit more persistent in trying to find a alive
+         parent when never_direct is used.
+       - nonhierarchical_direct squid.conf directive to make non-ICP
+         peer selection behave a bit more like ICP selection with respect
+         to hierarchy.
+       - Bugfix where netdb selection could override never_direct
+       - ICP timeout selection now prefers to use parents only when
+         calculating the dynamic timeout to compensate for common RTT
+         differences between parents and siblings.
 
 Changes to Squid-2.4.DEVEL2 ():
 
index 306452b2ca587cc2ccab0936920a0f18de4d8528..25e7a6a0ba29a2859b8fd693c08b595300f9d772 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.280 2000/05/02 18:32:41 hno Exp $
+ * $Id: neighbors.cc,v 1.281 2000/05/02 18:47:34 hno Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -374,6 +374,8 @@ neighborsUdpPing(request_t * request,
     icp_common_t *query;
     int queries_sent = 0;
     int peers_pinged = 0;
+    int parent_timeout = 0, parent_exprep = 0;
+    int sibling_timeout = 0, sibling_exprep = 0;
 
     if (Config.peers == NULL)
        return 0;
@@ -383,7 +385,6 @@ neighborsUdpPing(request_t * request,
     mem->start_ping = current_time;
     mem->ping_reply_callback = callback;
     mem->ircb_data = callback_data;
-    *timeout = 0.0;
     reqnum = icpSetCacheKey(entry->key);
     for (i = 0, p = first_ping; i++ < Config.npeers; p = p->next) {
        if (p == NULL)
@@ -438,8 +439,13 @@ neighborsUdpPing(request_t * request,
            (*exprep) += p->mcast.n_replies_expected;
        } else if (neighborUp(p)) {
            /* its alive, expect a reply from it */
-           (*exprep)++;
-           (*timeout) += p->stats.rtt;
+           if (neighborType(p, request) == PEER_PARENT) {
+               parent_exprep++;
+               parent_timeout += p->stats.rtt;
+           } else {
+               sibling_exprep++;
+               sibling_timeout += p->stats.rtt;
+           }
        } else {
            /* Neighbor is dead; ping it anyway, but don't expect a reply */
            /* log it once at the threshold */
@@ -488,15 +494,23 @@ neighborsUdpPing(request_t * request,
        }
     }
 #endif
+    /*
+     * How many replies to expect?
+     */
+    *exprep = parent_exprep + sibling_exprep;
+
     /*
      * If there is a configured timeout, use it
      */
     if (Config.Timeout.icp_query)
        *timeout = Config.Timeout.icp_query;
     else {
-       if (*exprep > 0)
-           (*timeout) = 2 * (*timeout) / (*exprep);
-       else
+       if (*exprep > 0) {
+           if (parent_exprep)
+               *timeout = 2 * parent_timeout / parent_exprep;
+           else
+               *timeout = 2 * sibling_timeout / sibling_exprep;
+       } else
            *timeout = 2000;    /* 2 seconds */
        if (Config.Timeout.icp_query_max)
            if (*timeout > Config.Timeout.icp_query_max)