[squid-users] LRU Statistics

2008-07-06 Thread Roy M.
I have the following cache stats:

Memory hits as % of hit requests:   5min: 51.7%
Disk hits as % of hit requests: 5min: 31.8%
Storage Mem capacity:   100.0% used,  0.0% free


i.e.,

cache miss in mem = 100 - 51.7 = 48.3%
overal hit % = 51.7 + 31.8 = 83.5%



1. Since memory is now 100% used, how do I know if there is a cache
miss in mem 48.3%,
how many % of them will trigger a LRU in memory cache?

2. Similarly, if my disk is 100% used, how do I know the LRU statistics



Thanks.


Re: [squid-users] LRU Statistics

2008-07-06 Thread Amos Jeffries

Roy M. wrote:

I have the following cache stats:

Memory hits as % of hit requests:   5min: 51.7%
Disk hits as % of hit requests: 5min: 31.8%
Storage Mem capacity:   100.0% used,  0.0% free


i.e.,

cache miss in mem = 100 - 51.7 = 48.3%
overal hit % = 51.7 + 31.8 = 83.5%



Note the text "as % of hit requests"

So...

cache hit in mem = 51.7%
cache hit in disk = 31.8%
cache hit in other (peers? refresh?) = 100 - 51.7 - 31.8 = 16.5%

miss information completely unknown.




1. Since memory is now 100% used, how do I know if there is a cache
miss in mem 48.3%,
how many % of them will trigger a LRU in memory cache?


Good question.



2. Similarly, if my disk is 100% used, how do I know the LRU statistics



Disk won't get 100% used unless you make your cache too big for the 
drive, or screw up cache gargbage collection with the cleanup settings.


Amos
--
Please use Squid 2.7.STABLE3 or 3.0.STABLE7


Re: [squid-users] LRU Statistics

2008-07-07 Thread Henrik Nordstrom
On mån, 2008-07-07 at 11:37 +0800, Roy M. wrote:

> 1. Since memory is now 100% used, how do I know if there is a cache
> miss in mem 48.3%,
> how many % of them will trigger a LRU in memory cache?

What do you mean by trigger a LRU? That Squid removes the LRU object to
make room for new content?

If you enable
debug_options ALL,1 47,2 

then Squid will log in cache.log when it has removed some disk content
by LRU. It is not as easy to get the memory removal policy logged as it
requires debug 20,3 which logs quite a bit...


Hmm... we really should add per store performance counters on this...

Regards
Henrik


signature.asc
Description: This is a digitally signed message part


Re: [squid-users] LRU Statistics

2008-07-07 Thread Roy M.
Hi,

On 7/7/08, Henrik Nordstrom <[EMAIL PROTECTED]> wrote:
> What do you mean by trigger a LRU? That Squid removes the LRU object to
>  make room for new content?

Yes, since it is very easy to fill in 100% of memory cache.

Sometimes we might want to know if LRU occur in memory too frequent in
a production server, then we might consider adding more memory, or
adjust the max. memory object size to reduce LRU for better
performance.


Thanks.


Re: [squid-users] LRU Statistics

2008-07-07 Thread Henrik Nordstrom
On tis, 2008-07-08 at 00:04 +0800, Roy M. wrote:

> Sometimes we might want to know if LRU occur in memory too frequent in
> a production server, then we might consider adding more memory, or
> adjust the max. memory object size to reduce LRU for better
> performance.

It should happen as frequent as you have new content entering the cache.


I would think the LRU age is more interesting, telling how long the
oldest object has stayed in cache...

Regards
Henrik


signature.asc
Description: This is a digitally signed message part


Re: [squid-users] LRU Statistics

2008-07-07 Thread Roy M.
Hi,

On 7/8/08, Henrik Nordstrom <[EMAIL PROTECTED]> wrote:
>
> It should happen as frequent as you have new content entering the cache.
>
>
>  I would think the LRU age is more interesting, telling how long the
>  oldest object has stayed in cache...
>

Sure, but sometimes it would be interesting to see by adjusting the
max. memory size, you could be able to reduce / increase the LRU per
second. (Of coz I don't have real knowledge if LRU is costly in term
of CPU cycle)

On the other hand, I have another idea is to have memory partition (or
disk partition), so not all URL are created equal, say domain1.com
would have 1GB memory cache and 10GB disk cache, domain2.com would
have 4GB memory cache, but no disk cache ect.

Thanks.


Re: [squid-users] LRU Statistics

2008-07-07 Thread Henrik Nordstrom
On tis, 2008-07-08 at 00:47 +0800, Roy M. wrote:

> Sure, but sometimes it would be interesting to see by adjusting the
> max. memory size, you could be able to reduce / increase the LRU per
> second. (Of coz I don't have real knowledge if LRU is costly in term
> of CPU cycle)

It will be the same most likely, the rate at which new content enters
the cache.

> On the other hand, I have another idea is to have memory partition (or
> disk partition), so not all URL are created equal, say domain1.com
> would have 1GB memory cache and 10GB disk cache, domain2.com would
> have 4GB memory cache, but no disk cache ect.

Hard to do with Squid, unless you run one Squid instane each..

Regards
Henrik


signature.asc
Description: This is a digitally signed message part