Re: Squid-2.2.RELEASE2: allow-miss cache_peer option

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sat, 15 May 1999 22:34:34 +0200

The patch file previously sent was incomplete (cache_cf.c change was
missing). Noticed this when I was about to make another patch today, and
two unexpected lines showed up in the next patch..

Patch description copied from the previous message:

allow-miss cache peer option disables the use if only-if-cached. It is
intended to be used in conjunction with ipc_hit_stale in tightly coupled
caches to allow better utilisation of refreshes. It will also needed if
someone gets around to implementing real CARP support.

This reminds me of the old question on digests and staleness. What about
(optionally) having digests with all "standard cachable objects", even
those needing to be refreshed? This flag can then control which kind of
digest that gets requested from the peer (standard, or including stale
objects). I think we have an excellent oppurturnity for a new cache
array model there.

Have N caches in one array, each exchanging digests including stale
objects and allowing miss access.

Have clients evenly distributed on the N caches using any distribution
method (DNS round robin, random, hashing or whatever).

Have cache_peer_access rules to prevent looping.

This way each cache can maintain their portion of the total cache, and
they all share the total cache size. This while having a close to zero
latency penalty regardless of the number of members of the array.

no-cache option can be used to control locality of objects. Without
no-cache the most used objects will end up on all caches which improves
latency and recovery of those objects, with no-cache only one copy of
the object will be stored (except for a few races.. where requests
arrives at more than one cache before digests have been exchanged with
those objects).

/Henrik

    [ Part 2: "Attached Text" ]

Index: squid/src/cf.data.pre
diff -u squid/src/cf.data.pre:1.1.1.35.2.3 squid/src/cf.data.pre:1.1.1.35.2.4
--- squid/src/cf.data.pre:1.1.1.35.2.3 Wed May 5 11:33:48 1999
+++ squid/src/cf.data.pre Fri May 14 00:15:55 1999
@@ -229,6 +229,7 @@
                      no-delay
                      login=user:password
                      connect-timeout=nn
+ allow-miss
 
                      use 'proxy-only' to specify that objects fetched
                      from this cache should not be saved locally.
@@ -279,6 +280,13 @@
 
                      use 'connect-timeout=nn' to specify a peer specific
                      connect timeout (see also peer_connect_timeout directive)
+
+ use 'allow-miss' to disable Squid's use of only-if-cached
+ when forwarding requests to siblings. This is primarily
+ useful when icp_hit_stale is used by the sibling. To
+ extensive use of this option may result in forwarding
+ loops, and you should avoid having two-way peerings
+ with this option.
 
         NOTE: non-ICP neighbors must be specified as 'parent'.
 
Index: squid/src/structs.h
diff -u squid/src/structs.h:1.1.1.37.6.4 squid/src/structs.h:1.1.1.37.6.5
--- squid/src/structs.h:1.1.1.37.6.4 Sun May 9 07:50:44 1999
+++ squid/src/structs.h Fri May 14 00:15:56 1999
@@ -1042,6 +1042,7 @@
 #if DELAY_POOLS
         unsigned int no_delay:1;
 #endif
+ unsigned int allow_miss:1;
     } options;
     int weight;
     struct {
Index: squid/src/http.c
diff -u squid/src/http.c:1.1.1.32.6.1 squid/src/http.c:1.1.1.32.6.2
--- squid/src/http.c:1.1.1.32.6.1 Sun May 2 16:18:36 1999
+++ squid/src/http.c Fri May 14 00:15:56 1999
@@ -842,7 +842,8 @@
     else if ((double) p->stats.n_keepalives_recv / (double) p->stats.n_keepalives_sent > 0.50)
         httpState->flags.keepalive = 1;
     if (httpState->peer)
- if (neighborType(httpState->peer, httpState->request) == PEER_SIBLING)
+ if (neighborType(httpState->peer, httpState->request) == PEER_SIBLING &&
+ !httpState->peer->options.allow_miss)
             httpState->flags.only_if_cached = 1;
     memBufDefInit(&mb);
     httpBuildRequestPrefix(req,
Index: squid/src/cache_cf.c
diff -u squid/src/cache_cf.c:1.1.1.29.4.2 squid/src/cache_cf.c:1.1.1.29.4.3
--- squid/src/cache_cf.c:1.1.1.29.4.2 Thu Apr 29 14:41:59 1999
+++ squid/src/cache_cf.c Sat May 15 22:28:10 1999
@@ -1049,6 +1049,8 @@
             p->login = xstrdup(token + 6);
         } else if (!strncasecmp(token, "connect-timeout=", 16)) {
             p->connect_timeout = atoi(token+16);
+ } else if (!strcasecmp(token, "allow-miss")) {
+ p->options.allow_miss = 1;
         } else {
             debug(3, 0) ("parse_peer: token='%s'\n", token);
             self_destruct();
Received on Tue Jul 29 2003 - 13:15:58 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:08 MST