Re: [squid-users] Finding files in squid cache.

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sat, 07 Sep 2013 14:01:19 +1200

On 7/09/2013 1:56 a.m., Alfredo Rezinovsky wrote:
> Les suppose I need to find a file logged as "00 00001234" in store log.
>
> I have a cache dir with 16 256 structure so the structure is
> $(dirs from 00 to 0F)/$(dirs from 00 to FF)/$(file)
>
> The first 00 means the first cache listed in squid.conf
>
> I have a file 00/12/00001234.
>
> the 12 is from the 5 and 6 position in the filename (or 4,5 depending
> if you count from 1 or 0)
>
> the first 00, where does it comes from?

It has been a whiel since I looked at it but IIRC the Squid fileno
format is:

* cache_dir identifier (bits 0-7)
* L1 sub-directory (_some_ [5] bits from 8-15)
* L2 sub-directory (_some_ [8] bits from 16-23)
* file unique part (any bits unused by L1 and L2 and bits 24-31)

In your case the number 0x00001234 is:

    (00) (00) (12) 34

* cache_dir identifier 00 - in bits 0-7
* L1 subdirectory 00 - in bits 8-12
* L2 subdirectory 24 - in bits 16-24

Or the path /cache/path/00/24/00001234

PS. If I was needing to analyse the directory (as sometimes I do while
debugging experimentd) it is easier to work with when the L1/L2 values
are made to fall nicely on the hexadecimal boundaries (ie multiples of 8
or 64).

Amos
Received on Sat Sep 07 2013 - 02:01:40 MDT

This archive was generated by hypermail 2.2.0 : Sat Sep 07 2013 - 12:00:03 MDT