Re: Squid's Logs

From: Duane Wessels <wessels@dont-contact.us>
Date: Wed, 06 Aug 97 15:56:00 -0700

kate@cee.hw.ac.uk writes:

>I am trying to simulate the behaviour of the cache (Squid 1.1.8) by
>monitoring the log files, specifically to record when objects enter and
>leave the cache.
>
>Can anyone tell me where I can find out more information about the
>fields in Squid logs? I've looked in the FAQs and release notes, but can
>only find out some stuff about the access logs. What I want to know is:
>
>1. From the access.log is there any way to see if the object *will*
>actually be cached (I have log_mime_headers on, http emulated),

Thats hard. If you wanted to mimic squid's behaviour, you'd have
to figure it out from the source code. Its a bit complex to
describe here. The HTTP RFCs document how it is supposed to work.

>2. The TCP_CLIENT_REFRESH : what is a "no-cache" pragma - that the

http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1945.txt

10.12 Pragma

   The Pragma general-header field is used to include implementation-
   specific directives that may apply to any recipient along the
   request/response chain. All pragma directives specify optional
   behavior from the viewpoint of the protocol; however, some systems
   may require that behavior be consistent with the directives.

       Pragma = "Pragma" ":" 1#pragma-directive

       pragma-directive = "no-cache" | extension-pragma
       extension-pragma = token [ "=" word ]

   When the "no-cache" directive is present in a request message, an
   application should forward the request toward the origin server even
   if it has a cached copy of what is being requested. This allows a
   client to insist upon receiving an authoritative response to its
   request. It also allows a client to refresh a cached copy which is
   known to be corrupted or stale.

   Pragma directives must be passed through by a proxy or gateway
   application, regardless of their significance to that application,
   since the directives may be applicable to all recipients along the
   request/response chain. It is not possible to specify a pragma for a
   specific recipient; however, any pragma directive not relevant to a
   recipient should be ignored by that recipient.

>object must not be cached? I see in the log files these are either
>TIMEOUT_DIRECT or DIRECT - what does this mean?

http://squid.nlanr.net/Squid/FAQ/FAQ-6.html#ss6.6

Hierarchy Data Tags

        DIRECT The object has been requested from the origin
                                server.

Almost any of these may be preceeded by 'TIMEOUT_' if the two-second
(default) timeout occurs waiting for all ICP replies to arrive from
neighbors.

>3. What is the relevance of the fields in the store.log - I presume
>"release" means it's purged from the cache and swapin/out refers to
>virtual memory(?) but how does it record when an object first enters the
>cache?

http://squid.nlanr.net/Squid/FAQ/FAQ-6.html#ss6.3

    action One of RELEASE, SWAPIN, or SWAPOUT.
               RELEASE means the object has been removed from the cache.
               SWAPOUT means the object has been saved to disk.
               SWAPIN means the object existed on disk and has been
                       swapped into memory.

>
>4. What are all the other fields in the store.log?

http://squid.nlanr.net/Squid/FAQ/FAQ-6.html#ss6.3

The store.log consists of the following fields:

    time The time this entry was logged. The value is the
               raw Unix time plus milliseconds.

    action One of RELEASE, SWAPIN, or SWAPOUT.
               RELEASE means the object has been removed from the cache.
               SWAPOUT means the object has been saved to disk.
               SWAPIN means the object existed on disk and has been
                       swapped into memory.

    status The HTTP reply code.

    The following three fields are timestamps parsed from the HTTP
    reply headers. All are expressed in Unix time. A missing header
    is represented with -2 and an unparsable header is represented as -1.

    datehdr The value of the HTTP Date reply header. If the Date
               header is missing or invalid, the time of the request
               is used instead.

    lastmod The value of the HTTP Last-Modified: reply header.

    expires The value of the HTTP Expires: reply header.

    type The HTTP Content-Type reply header.

    expect-len The value of the HTTP Content-Length reply header.
               Zero if Content-Length was missing.

    real-len The number of bytes of content actually read. If the
               expect-len is non-zero, and not equal to the real-len,
               the object will be released from the cache.

    method HTTP request method

    key The cache key. Often this is simply the URL. Cache objects
               which never become public will have cache keys that include
               a unique integer sequence number, the request method, and
               then the URL.

Duane W.
Received on Wed Aug 06 1997 - 15:57:51 MDT

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