Re: Which method are used to store cache objects?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 21 Mar 1999 00:28:35 +0100

Robert Wall wrote:

> Does anybody know offhand the exact method that Squid uses to store cached
> objects?

A hash based memory index is kept containing basic metadata on all the
objects, mapping URLs to disk files and/or memory cache.

On-disk cache directories are used in a circular fashion to maintain
some locality of related objects.

If you have multiple cache_dir entries then Squid will spread the load
on the 2/3 least used cache_dir entries (recalculated approximately
every n_cache_dir*2/3 request).

Number of directories used in each cache_dir depends on the size of the
cache_dir. Squid uses 2*cache_dir_size/store_avg_object_size/L2 level 2
directories with L2 files in each to store the objects (or divided by L2
level 1 directories). The reason why twice as many directories is used
is to limit the amount of filesystem fragmenting by having each
directory fairly purged by the time it is reused.

--
Henrik Nordstrom
Spare time Squid hacker
Received on Sat Mar 20 1999 - 16:14:32 MST

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