Re: TCP_REFRESH_HIT a MISS

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 04 Aug 1999 20:53:10 +0200

Jens-S. Voeckler wrote:
>
> Hi,
>
> I have a question concerning the HIT \/ MISS of a few things.
>
> 1) A TCP_REFRESH_HIT in my log files always results in a contact to the
> origin site. I may be willing to count the IMS exchange with a result of
> TCP_REFRESH_HIT/304 a HIT, but a TCP_REFRESH_HIT/200 transfered the
> complete object from elsewhere. Why is it logged as TCP_REFRESH_HIT when
> it is, in fact, a MISS? What is the big difference compared with a
> TCP_REFRESH_MISS, then?

TCP_REFRESH_HIT/200 is a cache HIT where Squid first needed to
revalidate the object with the origin server. The reply from the origin
server was a small 304 reply.

TCP_REFRESH_HIT/304 is when the client sent a IMS query to the cache,
the cache needed to validate it's cached object and both the clients
cache and the Squid cache was up to date.

If you need to count "miss" traffic then both are about the same. The
size of a IMS query with a 304 reply.

> 2) In some older log files (2.1p2) I saw a "TCP_HIT/301 ... DIRECT/..."
> Since the destination site was obviously contacted to get the "moved
> permanently", why was is logged as a HIT? It seems to be fixed in
> 2.2s4+hno-990713 (it also seemed to be one symptom of fwd loops). It is
> now correctly logged as NONE, if it was a HIT...

From Squid-2.2.STABLE3 ChangeLog:
        - Fixed a case in clientCacheHit() where we thought it
          was a hit, but the reply status was not 200, so we
          had to perform a cache miss. We forgot to change the
          log_type and these were being recorded as TCP_HIT's.

> 3) For the developers: Is it possible to express the parent/sibling
> relationship configured in squid.conf appropriately in the log file for
> cache digest hits, e.g. log a CD_(PARENT|PEER)_HIT?

Ofcourse. Patch attached.

--
Henrik Nordstrom
Spare time Squid hacker

Index: squid/src/enums.h
diff -u squid/src/enums.h:1.1.1.34.2.2 squid/src/enums.h:1.1.1.34.2.3
--- squid/src/enums.h:1.1.1.34.2.2 Tue Jul 13 00:45:18 1999
+++ squid/src/enums.h Wed Aug 4 20:45:37 1999
@@ -290,7 +290,8 @@
     SOURCE_FASTEST,
     ROUNDROBIN_PARENT,
 #if USE_CACHE_DIGESTS
- CACHE_DIGEST_HIT,
+ CD_PARENT_HIT,
+ CD_SIBLING_HIT,
 #endif
 #if USE_CARP
     CARP,
Index: squid/src/peer_select.c
diff -u squid/src/peer_select.c:1.1.1.30.2.6 squid/src/peer_select.c:1.1.1.30.2.7
--- squid/src/peer_select.c:1.1.1.30.2.6 Tue Jul 13 00:39:16 1999
+++ squid/src/peer_select.c Wed Aug 4 20:45:37 1999
@@ -52,7 +52,8 @@
     "SOURCE_FASTEST",
     "ROUNDROBIN_PARENT",
 #if USE_CACHE_DIGESTS
- "CACHE_DIGEST_HIT",
+ "CD_PARENT_HIT",
+ "CD_SIBLING_HIT",
 #endif
 #if USE_CARP
     "CARP",
@@ -321,7 +322,10 @@
     }
 #if USE_CACHE_DIGESTS
     if ((p = neighborsDigestSelect(request, entry))) {
- code = CACHE_DIGEST_HIT;
+ if (neighborType(p, request) == PEER_PARENT)
+ code = CD_PARENT_HIT;
+ else
+ code = CD_SIBLING_HIT;
     } else
 #endif
 #if USE_CARP
Received on Wed Aug 04 1999 - 12:50:16 MDT

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