<<Back

CACHE SIZE

Tag Namecache_mem
Usagecache_mem bytes

Description
'cache_mem' specifies the ideal amount of memory to be used for :

  • In-Transit objects
  • Hot Objects
  • Negative-Cached objects

Data for these objects are stored in 4 KB blocks. This parameter specifies the ideal upper limit on the total size of 4 KB blocks allocated. In-transit objects have priority over the others. When additional space is needed for incoming data, negative-cached and hot objects will be released. In other words, the negative-cached and hot objects will fill up any unused space not needed for in-transit objects. If circumstances require, this limit will be exceeded. Specifically, if your incoming request rate requires more than 'cache_mem' of memory to hold in-transit objects, Squid will exceed this limit to satisfy the new requests. When the load decreases, blocks will be freed until the high-water mark is reached. Thereafter, blocks will be used to store hot objects.

Defaultcache_mem 8 MB

Example
cache_mem 1 GB

Caution
This parameter does not specify the maximum process size. It places a limit on one aspect of squid's memory usage. Squid uses memory for other things as well. Process will probably become twice or three times bigger than the value put here.

 

Tag Namecache_swap_low (percent, 0-100)
Usagecache_swap_low percentage

Description
This tag is used to specify the low-water mark 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. If utilization is close to the low-water mark, less replacement is done each time.

Defaultcache_swap_low 90

Example
cache_swap_low 95

Caution
If you have a large cache, 5% could be hundreds of MB. If this is the case, you may wish to set this number closer together.

 

Tag Namecache_swap_high (percent, 0-100)
Usagecache_swap_high percentage

Description
This tag is used to specify the high-water mark for cache object aggressive replacement. As swap utilization gets close to high-water mark, object eviction becomes more aggressive.

Defaultcache_swap_high 95

Example
cache_swap_high 98

Caution
If you have a large cache, 5% could be hundreds of MB. If this is the case, you may wish to set this number closer together.

 

Tag Namemaximum_object_size (bytes)
Usagemaximum_object_size (bytes)

Description
Objects larger than this size will NOT be saved on disk. The value is specified in kilobytes, and the default is 4 MB. If you wish to get a high BYTES hit ratio, you should probably increase this (one 32 MB object hit counts for 3200 10 KB hits). If you wish to increase speed more than your want to save bandwidth, you should leave this low. During the initial downloading of a file, the downloading time seems to be a normal one, but if you download the same file again, the time it takes for download will be very minimum. This indicates that, the file comes from the Cache.

Defaultmaximum_object_size 4096 KB

Example
maximum_object_size 2000 KB

Caution
If using the LFUDA replacement policy you should increase this value to maximize the byte hit rate improvement of LFUDA. See replacement_policy for a discussion of this policy.

 

Tag Nameminimum_object_size (bytes)
Usageminimum_object_size (bytes)

Description
Objects smaller than this size will NOT be saved on disk. The value is specified in kilobytes, and the default is 0 KB, which means there is no minimum. See maximum_object_size for more information.

Defaultminimum_object_size 0 KB

Example
minimum_object_size 2000 KB

Note
See maximum_object_size, which is reversibly applicable.

 

Tag Namemaximum_object_size_in_memory (bytes)
Usagemaximum_object_size_in_memory (bytes)

Description
Objects greater than this size will not be attempted to be kept in the memory cache. This should be set high enough to keep objects accessed frequently in memory to improve performance while, low enough to keep larger objects from hoarding cache_mem.

Defaultmaximum_object_size_in_memory 8 KB

Example
maximum_object_size_in_memory 20 KB


Tag Nameipcache_size (number of entries)
Usageipcache_size (number of entries)

Description
This tag is used to specify the size of the ipcache.

Defaultipcache_size 1024

 

Tag Nameipcache_low (percent)
Usageipcache_low percentage

Description
This specifies the low water mark for caching IP addresses.

Defaultipcache_low 90

 

Tag Nameipcache_high (percent)
Usageipcache_high percentage

Description
This specifies the high water mark for caching IP addresses.

Defaultipcache_high 95

 

 

Tag Namefqdncache_size
Usagefqdncache_size (number of entries)

Description
This specifies the maximum number of FQDN cache entries.

Defaultfqdncache_size 1024

 

 

Tag Namecache_replacement_policy
Usagecache_replacement_policy policy

Description
The cache replacement policy parameter decides which objects will remain in cache and which objects are evicted (replaced) to create space for the new objects.

  • LRU : Squid's original list based LRU policy
  • heap GDSF : Greedy-Dual Size Frequency
  • heap LFUDA : Least Frequently Used with Dynamic Aging
  • heap LRU : LRU policy implemented using a heap

This applies to any cache_dir lines listed below this.
The LRU policies keep recently referenced objects. i.e., it replaces the object that has not been accessed for the longest time.

The heap GDSF policy optimizes object-hit rate by keeping smaller popular objects in cache. So it has a better chance of getting a hit. It achieves a lower byte hit rate than LFUDA though, since it evicts larger (possibly popular) objects.

The heap LFUDA ( Least Frequently Used with Dynamic Aging ) policy keeps popular objects in cache regardless of their size and thus optimizes byte hit rate at the expense of hit rate since one large, popular object will prevent many smaller, slightly less popular objects from being cached.

Both policies utilize a dynamic aging mechanism that prevents cache pollution that can otherwise occur with frequency-based replacement policies.

For more information about the GDSF and LFUDA cache replacement policies see http://www.hpl.hp.com/techreports/1999/HPL-1999-69.html and http://fog.hpl.external.hp.com/techreports/98/HPL-98-173.html .

Defaultcache_replacement_policy lru

Example
cache_replacement_policy heap LFUDA
To use this policy, Squid should be built with configure option --enable-removal-policy=heap or simply --enable-removal-policy.

Caution
If using the LFUDA replacement policy, the value of maximum_object_size should be increased above its default of 4096 KB to maximize the potential byte hit rate improvement of LFUDA. If needed to use other policies than default, squid should be built with configure option --enable-removal-policies.

 

Tag Namememory_replacement_policy
Usagememory_replacement_policy policy

Description
The memory replacement policy parameter determines which objects are purged from memory, when memory space is needed.

See cache_replacement_policy for details

Defaultmemory_replacement_policy lru

 

 

<<Back
 


All rights reserved.
All trademarks used in this document are owned by their respective companies. This document makes no ownership claim of any trademark(s). If you wish to have your trademark removed from this document, please contact the copyright holder. No disrespect is meant by any use of other companies’ trademarks in this document.
Note: The pages on this website cannot be duplicated on to another site. Copying and usage of the contents for personal and corporate purposes is acceptable. In near future, it will be released under the GNU Free Documentation License.
© ViSolve.com 2002 
Created By: squid@visolve.comDate: May 15,2002
Revision No:0.0 
Modified ByDate