]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
From: Stewart Forster <slf@connect.com.au>
authorwessels <>
Thu, 10 Sep 1998 00:18:02 +0000 (00:18 +0000)
committerwessels <>
Thu, 10 Sep 1998 00:18:02 +0000 (00:18 +0000)
Another important patch for HIGH loads.  Someone mentioned once when we were
designing the automatic comm_select_incoming counters tuning code that we
should try not to check too often.  I argued against that and I was wrong.
At high loads, the sheer load of polling starts to bite badly, and so the
below patch reduces the amount of polling needed.  Now squid slows down more
sanely at really high loads (rather than brick wall).  Ideally these values
should be configurable and called:

incoming_icp_average 6
incoming_http_average 4
min_icp_poll_cnt 8
min_http_poll_cnt 8

but I don't have the time to write this up.  These values will definately
vary from site to site depending on the ICP/HHTP load ratio.  The above
values work okay for us, but maybe not for everyone.....

The lower the poll_cnts will mean the more rapid the polling.
The lower the incoming_*_average will mean the more rapid the polling.
The min_*_poll_cnt will put a maximum limit on the rate of polls.

src/cf.data.pre
src/comm_select.cc
src/structs.h

index a32c4f2cc6cb780a130a16dfe42a465f18cef18c..68b43b9d6c4003c80a10c1d052cae0047f787db5 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.102 1998/09/09 17:47:09 wessels Exp $
+# $Id: cf.data.pre,v 1.103 1998/09/09 18:18:02 wessels Exp $
 #
 #
 # SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -2546,3 +2546,32 @@ DOC_START
        individual host delay pool traffic allowances.
 DOC_END
 EOF
+
+NAME incoming_icp_average
+TYPE: int
+DEFAULT: 6
+LOC: Config.comm_incoming.icp_average
+DOC_NONE
+
+NAME incoming_http_average
+TYPE: int
+DEFAULT: 4
+LOC: Config.comm_incoming.http_average
+DOC_NONE
+
+NAME min_icp_poll_cnt
+TYPE: int
+DEFAULT: 8
+LOC: Config.comm_incoming.icp_min_poll
+DOC_NONE
+
+NAME min_http_poll_cnt
+TYPE: int
+DEFAULT: 8
+LOC: Config.comm_incoming.http_min_poll
+DOC_START
+       Heavy voodoo here.  I can't even beleve you are reading this.
+       Are you crazy?  Don't even think about adjusting these unless
+       you understand the algorithms in comm_select.c first!
+DOC_END
+
index f0d34c23a0fd062c18a06a6c8c00e99dd9901c9c..bd657a4ca0ec3233712564386d063c578aba3c81 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: comm_select.cc,v 1.8 1998/09/04 23:04:42 wessels Exp $
+ * $Id: comm_select.cc,v 1.9 1998/09/09 18:18:03 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -216,9 +216,10 @@ comm_poll_icp_incoming(void)
     if (nfds == 0)
        return;
     nevents = comm_check_incoming_poll_handlers(nfds, fds);
-    incoming_icp_interval = incoming_icp_interval + 1 - nevents;
-    if (incoming_icp_interval < 0)
-       incoming_icp_interval = 0;
+    incoming_icp_interval = incoming_icp_interval
+       + Config.comm_incoming.icp_average - nevents;
+    if (incoming_icp_interval < Config.comm_incoming.icp_min_poll)
+       incoming_icp_interval = Config.comm_incoming.icp_min_poll;
     if (incoming_icp_interval > MAX_INCOMING_INTERVAL)
        incoming_icp_interval = MAX_INCOMING_INTERVAL;
     if (nevents > INCOMING_ICP_MAX)
@@ -242,9 +243,10 @@ comm_poll_http_incoming(void)
        fds[nfds++] = HttpSockets[j];
     }
     nevents = comm_check_incoming_poll_handlers(nfds, fds);
-    incoming_http_interval = incoming_http_interval + 1 - nevents;
-    if (incoming_http_interval < 0)
-       incoming_http_interval = 0;
+    incoming_http_interval = incoming_http_interval
+       + Config.comm_incoming.http_average - nevents;
+    if (incoming_http_interval < Config.comm_incoming.http_min_poll)
+       incoming_http_interval = Config.comm_incoming.http_min_poll;
     if (incoming_http_interval > MAX_INCOMING_INTERVAL)
        incoming_http_interval = MAX_INCOMING_INTERVAL;
     if (nevents > INCOMING_HTTP_MAX)
index 5b818170c23e1679a5bf3ba74fa13d975773d556..9aaba6d3a3597fc7e5fb523c206029eb535463ca 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.217 1998/09/04 23:05:04 wessels Exp $
+ * $Id: structs.h,v 1.218 1998/09/09 18:18:05 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -424,6 +424,12 @@ struct _SquidConfig {
        } class3;
     } Delay;
 #endif
+    struct {
+       int icp_average;
+       int http_average;
+       int icp_min_poll;
+       int http_min_poll;
+    } comm_incoming;
 };
 
 struct _SquidConfig2 {