Re: efficency of squid

From: Duane Wessels <wessels@dont-contact.us>
Date: Thu, 07 May 1998 14:23:33 -0600

Holger Reif writes:

>I want to know, how "good" squid works. This is to get something
>like:
>100 MB requested
> 30 MB served from cache
> 10 MB fetched from parent/sibling 1
> 10 MB fetched from parent/sibling 2
> 50 MB fetched from original servers
>
>The scripts from the squid homepage doen't seem to provide this
>info to me.
>
>My question: which items should I loot at in the log file?
>I.e: which ResultCodes belong to which category and which
>numbers should be counted together?
>
>I hope to get the scritp done bymyself ;-)

We do something similar for our own caches. The results are at
    http://ircache.nlanr.net/Cache/Statistics/Hierarchy/

Here's the guts of a perl script which reads the access log and
categorizes each request.

while (<>) {
        chop;
        @F = split;
        $L = $F[3];
        $H = $F[8];
        $S = $F[4];
        next unless ($L =~ /TCP_/); # skip UDP and errors
        $all_total_count++;
        $all_total_bytes += $S;
        if ($H =~ /TIMEOUT/) {
                $all_timeout_count++;
                $all_timeout_bytes += $S;
        }
        if ($L =~ /HIT/) {
                $all_local_hit_count++;
                $all_local_hit_bytes += $S;
        } elsif ($H =~ /HIT/) {
                $all_remote_hit_count++;
                $all_remote_hit_bytes += $S;
        } elsif ($H =~ /MISS/) {
                $all_remote_miss_count++;
                $all_remote_miss_bytes += $S;
        } elsif ($H =~ /DIRECT/) {
                $all_direct_count++;
                $all_direct_bytes += $S;
        } else {
                $all_other_count++;
                $all_other_bytes += $S;
        }
}

Duane W.
Received on Thu May 07 1998 - 13:27:28 MDT

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