replacement policy

From: Yee Man Chan <ymc@dont-contact.us>
Date: Thu, 26 Feb 1998 14:14:09 -0500 (EST)

Hi,

        I changed squid 1.1.20's to use Biggest File get replaced First
algorithm (are there any acronym for this one?). What I did was changed
the comparison function argument of qsort inside storeGetSwapSpace to a
function like this:

static int
compareStoreSize(StoreEntry ** e1, StoreEntry ** e2)
{
    if (!e1 || !e2)
        fatal_dump(NULL);
    if ((*e1)->object_len > (*e2)->object_len)
        return (-1);
    if ((*e1)->object_len < (*e2)->object_len)
        return (1);
    return (0);
}

I guess this should work. However, when I try to use a script to analyze
store.log. I find that some 0 bytes mysterious files, cgi generated
things and some other unspecial (under my perception) are getting RELEASEd
first. Although I find a trace of files that look like reflecting my
modification, since I don't know the last ref time of a file, I cannot
tell whether it is LRU or Biggest File First. So here are the questions:

1. What is the removal policy in Squid? It looks like it is more
complicated than just a few lines of code in storeGetSwapSpace. Please
explain in detail. (Note: when I say which file is removed, I mean that
file has a RELEASE action being done on it.)

2. Are there anyway to get the corresponding last ref time of a
RELEASEd file without parsing both access.log and store.log?

Thanks for attention.
Yee Man Chan
Received on Thu Feb 26 1998 - 11:16:33 MST

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