[squid-users] Surprizing distribution of files in cache dir

From: Denis Vlasenko <vda@dont-contact.us>
Date: Fri, 1 Aug 2003 12:19:24 +0300

Hi folks,

After some period of squid use, I decided to look at cache dir contents.

I have plain simple cache dir configuration:

cache_dir ufs /var/app/squid-2.5.STABLE1-20021119/cache 4096 128 128

i.e. 4G of 128*128 dirs.

My cache dir is on reiserfs partition. I think reiserfs will
store small files efficiently.

As of today, cache dir contains 717,764,096 bytes, looks like
1/5 of max allowed capacity... ok.

In a cache dir, I did

#!/bin/sh
for a in */*; do echo `ls -1 $a | wc -l` $a; done >count
cut -d ' ' -f 1 count | sort | uniq -c >sorted
cat sorted

Result:
  15671 0 <----- almost 124*128 of empty dirs ?!
      1 101
      1 115
      3 117
      1 119
      1 121
      1 122
      3 123
      2 124
      1 125
     10 126
     40 127
    564 128
      1 54

Is this expected and ok or not? I feel strange to have
so much empty directories...

I'd appreciate if you will send me a snippet of squid.conf
with your cache configuration, measure total size of
your cache dir and run the same script for me. Yes, you.

Thanks.

--
vda
Received on Fri Aug 01 2003 - 03:19:51 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:18:31 MST