Re: Swap file numbers! Help!

From: Dancer <dancer@dont-contact.us>
Date: Mon, 22 Dec 1997 16:43:56 +1000

Well, it's cheap and it's nasty, but if you run it in your top-level cache
directory it gives you the average object size...assuming your 'du' accepts the -k
option, and that you've got egrep. On my lan cache, I get 13.8. I'll have to try
it on the main cache. Beware: this sucker will take quite a while, and chew quite
a bit of memory doing it.

#!/usr/local/bin/perl

@cachefiles=`du -k -a ?? | egrep ../../........\$`;

$numitems=$#cachefiles+1;
$Total=0;

print "Number of cache items=$numitems\n";
foreach(@cachefiles)
        {
        chomp;
        @data=split(' ');
        $Total=$Total+$data[0];
        }
print "Total size of objects: $Total\n";
$avg=$Total/$numitems;
print "Average object size: $avg K\n";

Dancer wrote:

> I sense that a script to work out store_avg_object_size automagically from an
> existing cache might be in order. That'd give us some more realistic numbers,
> yes?
>
> D
>
> Stewart Forster wrote:
>
> > >
> > > Got a .19 doing it here too. Is this a .19 'feature'?
> > >
> >
> > Found the problem. On line 1759 in store.c, you'll see that
> > MAX_SWAP_FILE gets set to be 1.5 times the predicted number of swap files.
> >
> > There are two ways of fixing this:
> >
> > (not recommended)
> > 1) Recompile - edit store.c and change the multiplier from * 3 / 2 to * 2
> >
> > (recommended)
> > 2) Edit config and restart squid - Change the store_avg_object_size value
> > down. You obviously have it set WAY too high. Whatever value is there now,
> > halve it and you should then be fine.
> >
> > Cheers,
> >
> > Stew.
>
> --
> Note to evil sorcerers and mad scientists: don't ever, ever summon powerful
> demons or rip holes in the fabric of space and time. It's never a good idea.
> ICQ UIN: 3225440

--
Note to evil sorcerers and mad scientists: don't ever, ever summon powerful
demons or rip holes in the fabric of space and time. It's never a good idea.
ICQ UIN: 3225440
Received on Sun Dec 21 1997 - 22:48:42 MST

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