Re: [squid-users] swap.state and perl unpack question

This is a discussion on Re: [squid-users] swap.state and perl unpack question within the Squid Users forums, part of the Web Server and Related Forums category; Hello, I got the unpacking fixed! > > ($metaop,$metapad,$metafilenum,$metatimestamp,$met alastref,$metaexpires,$metalastmod, > $metafilesz,$metarefcount,$metaflags,$...


Go Back   Usenet Forums > Web Server and Related Forums > Squid Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-07-2004
OTR Comm
 
Posts: n/a
Default Re: [squid-users] swap.state and perl unpack question

Hello,

I got the unpacking fixed!

>
> ($metaop,$metapad,$metafilenum,$metatimestamp,$met alastref,$metaexpires,$metalastmod,
> $metafilesz,$metarefcount,$metaflags,$metakey) = unpack $binary_layout,
> $record;


I had my unpack incorrect, it should be

($metaop,$metafilenum,$metatimestamp,$metalastref, $metaexpires,$metalastmod,
$metafilesz,$metarefcount,$metaflags,$metakey) = unpack $binary_layout,
$record;

and then I get for output:
<snip>
binary_layout: A1 x3 i l l l l l s s A16
recordlen: 48
metaop: ^A
metafilenum: 0000001B
metatimestamp: 1076866068
metalastref: 1076866068
metaexpires: -1
metalastmod: 1053759007
metafilesz: 3179
metarefcount: 1
<snip>

I am not handling the 'op' field correctly, but I will work on that
later.

But the questions about swap.log and swap.state are still open.

>
> >
> > Most if not all of this information is also logged in swap.log where you
> > also have access to the URL etc, provided it's known by Squid at the
> > time.

>
> I would rather use the swap.state data since it has more information,
> but I looked at using swap.log.
>
> I didn't have the cache_swap_log option set in squid.conf, but I turned
> it on and pointed to /usr/local/squid/var/logs/swap.log
>
> I restarted (not reloaded) squid and swap.log.00 got created. When it
> first got created, it had the same size as my swap.state file, but as
> soon as I went to some sites not cached, the swap.log file updated, but
> the swap.state file remained unchanged (both size and timestamp). Are
> swap.log and swap.state mutually exclusive?
>
> Now, I restarted squid again, and still the swap.state file remained
> unchanged. So it appears that if I have swap.log enabled, swap.state is
> not updated, right? If not, how/when is swap.state updated?
>
> Also, what is the binary layout for the swap.log?
>


Thanks,

Murrah Boswell
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:42 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0