Re: [squid-users] Re: How much disk space is reclaimed by the cache replacement algorithms?

2009-12-30 Thread Amos Jeffries

RW wrote:

On Wed, 23 Dec 2009 13:44:54 -0900
Chris Robertson crobert...@gci.net wrote:


RW wrote:

On Wed, 23 Dec 2009 17:58:41 +0100
Matus UHLAR - fantomas uh...@fantomas.sk wrote:


  

1. How often is the replacement done?
  

when the percentage of configured cache_dir size crosses the
cache_swap_high value.


I haven't looked at the code for a long-time and I only looked at
2.x, but  cache_swap_high didn't seem to play any part that I could
see. It's certainly not a simple high/low watermark algorithm.



  

 From http://www.squid-cache.org/Doc/config/cache_swap_high/...


The low- and high-water marks for cache object replacement.
Replacement begins when the swap (disk) usage is above the
low-water mark and attempts to maintain utilization near the
low-water mark.  As swap utilization gets close to high-water
mark object eviction becomes more aggressive.  If utilization
is close to the low-water mark less replacement is done each time.



But as I said  cache_swap_high doesn't actually do anything in the 2.x
code, and given that that description has been around a long time I
doubt anything has changed in 3.x.



Garbage collection occurs at specific intervals. Default is hourly.
AFAIUI (from the paper, not the code)... between high and low items are 
checked for freshness according to the replacement algorithm. Above high 
watermark everything marked for potential removal by the replacement 
algorithm is removed regardless of staleness.


So ...

 * the low-volume cache stays low because live requests are performing 
the replacement of stale objects instead of garbage collection.


 * between low and high water marks an old but fresh object will be 
retained over a newer but definitely stale object.



Amos
--
Please be using
  Current Stable Squid 2.7.STABLE7 or 3.0.STABLE20
  Current Beta Squid 3.1.0.15


Re: [squid-users] Re: How much disk space is reclaimed by the cache replacement algorithms?

2009-12-23 Thread Chris Robertson

RW wrote:

On Wed, 23 Dec 2009 17:58:41 +0100
Matus UHLAR - fantomas uh...@fantomas.sk wrote:


  

1. How often is the replacement done?
  

when the percentage of configured cache_dir size crosses the
cache_swap_high value.



I haven't looked at the code for a long-time and I only looked at 2.x,
but  cache_swap_high didn't seem to play any part that I could see.
It's certainly not a simple high/low watermark algorithm.

If you run a low-volume cache the percentage never budges
from  cache_swap_low (give or take a few objects), and if you shrink the
cache size a little, it corrects within a couple of minutes, whether
or not you hit the new cache_swap_high.
  


From http://www.squid-cache.org/Doc/config/cache_swap_high/...


The low- and high-water marks for cache object replacement.
Replacement begins when the swap (disk) usage is above the
low-water mark and attempts to maintain utilization near the
low-water mark.  As swap utilization gets close to high-water
mark object eviction becomes more aggressive.  If utilization is
close to the low-water mark less replacement is done each time.

Defaults are 90% and 95%. If you have a large cache, 5% could be
hundreds of MB. If this is the case you may wish to set these
numbers closer together.



Hope that helps clear it up.

Chris