Disclaimer: This manual is NOT a Squid tutorial. It is only a reference material that provides detailed explanation of all configuration parameters available in Squid 3.0. The reader is expected to have prior knowledge of basic Squid installation and configuration. For Complete tutorial on Squid, please visit http://www.squid-cache.org

Squid 3.0 Configuration Manual - Cachesize Parameters
Squid 3.0 Configuration Manual


OPTIONS WHICH AFFECT THE CACHE SIZE

Tags under this section deals with cache memory configurations like cache memory size, swap size, maximum and minimum object size, cache and memory replacement policies.

cache_mem cache_swap_low cache_swap_high maximum_object_size minimum_object_size
maximum_object_size_in_memory ipcache_size ipcache_low ipcache_high fqdncache_size
cache_replacement_policy memory_replacement_policy      
      TAG NAME                   cache_mem















Description  cache_mem defines the ideal amount of memory to be used for In-Transit objects, Hot Objects, Negative-Cached
 objects
Build Option
 Default
Usage
 cache_mem size
Default
 cache_mem 8 MB

Synopsis
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.

Note:
This tag 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.

Arguments
size
 Cache memory size

Example(s)
cache_mem 32 MB

      TAG NAME                   cache_swap_low, cache_swap_high
















Description  This defines low- and high-water marks for cache object replacements
Build Option
 Default
Usage
 cache_swap_low  percent( 0-100 )
 cache_swap_high
percent( 0-100 )
Default
 cache_swap_low 90
 cache_swap_high 95

Synopsis
This tags define when the replacement should take place. 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.

Arguments
percent
 low and high level in percentage

Example(s)
cache_swap_low 50
cache_swap_high 75

      TAG NAME                   maximum_object_size









Description  Defines maximum size for objects to be stored in the disk
Build Option
 Default
Usage
 maximum_object_size size
Default
 object_size 4096 KB

Synopsis
Objects larger than this size will NOT be saved on disk. The value is specified in kilobytes, and the default is 4MB.  If you wish to get a high BYTES hit ratio, you should probably increase this (one 32 MB object hit counts for 3200 10KB hits).  Leave this value low if you wish to increase the speed more than what you want to save bandwidth.

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

Arguments
size
 Maximum object size

Example(s)
maximum_object_size 320010 KB

      TAG NAME                   minimum_object_size









Description  Specifies the minimum object size below which will not be saved to the disk
Build Option
 Default
Usage
 minimum_object_size size 
Default
 minimum_object_size 0 KB

Synopsis
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.

Arguments
size
 Minimum object size

Example(s)
minimum_object_size 10 KB

      TAG NAME                   maximum_object_size_in_memory










Description  Defines maximum size of the object to be kept in memory cache
Build Option
 Default
Usage
 maximum_object_size_in_memory  size 
Default
 maximum_object_size_in_memory 8 KB 

Synopsis
Objects greater than the size specified in this tag will not be kept in the memory cache. This should be set high enough to keep objects accessed frequently in memory to improve performance at the same time low enough to keep larger objects from hoarding cache_mem.

Arguments
size
 Maximum size of the object to be kept in memory cache

Example(s)
maximum_object_size_in_memory 100 KB

      TAG NAME                  ipcache_size, ipcache_low, ipcache_high





Description  The size of the cache used for IP addresses and the high and low water marks for the same
Build Option
 Default
Usage  ipcache_size number of entries
 
ipcache_low percent
 ipcache_high percent
Default
 ipcache_size 1024
 ipcache_low 90
 ipcache_high 95
 

Synopsis
Defines the size of cache needed for caching ip address, also its low and high water marks.

Arguments
number of entries  Number of entries to be cached
percent
 low and high level for the ipcache in percentage

Example(s)
ipcache_size 2048
ipcache_low 90
ipcache_high 95

      TAG NAME                   fqdncache_size







Description  Defines the size of in memory cache needed for fully qualified domain names
Build Option
 Default
Usage
 fqdncache_size number of entries
Default
 fqdncache_size 1024 

Synopsis
This is used to specify maximum number of entries for fully qualified domain names. Defaults to 1024, which is usually a safe value. In environments where DNS queries are slow, raising this may help.

Arguments
number of entries  Number of fully qualified domains to be cached

Example(s)
fqdncache_size 2048

      TAG NAME                   cache_replacement_policy







Description  The cache replacement policy parameter determines which objects are to be replaced when disk space is needed
Build Option
 --enable-removal-policy
Usage
 cache_replacement_policy policy
Default
 cache_replacement_policy lru 

Synopsis
Whenever space for new objects were not found in the disk, cache_replacement_policy tag determines which objects in the cache memory (disk) should be replaced.

The cache replacement policies is of four types. They are,

Policy
 Explanation
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 keeps recently referenced objects.

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 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.

Note:
If using the LFUDA replacement policy you should increase the value of maximum_object_size above its default of 4096 KB to maximize the potential byte hit rate improvement of LFUDA.

Arguments
policy
 One of the above mentioned policies

Example(s)
cache_replacement_policy heap LFUDA

      TAG NAME                   memory_replacement_policy







Description  Specifies the policy for object replacement in memory when space for new objects is not available
Build Option
 Default
Usage
 memory_replacement_policy policy
Default
 memory_replacement_policy lru 

Synopsis
Like cache_replacement_policy, this applies to memory space (RAM) for object replacement when the required space is not available for new objects.

Policies are same as cache_replacemen_policy.

Arguments
policy
 One of the policies mentioned in cache_replacement_policy tag

Example(s)
memory_replacement_policy LFUDA



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.
 
 
Revision No: 1.0  
Last Modified By: ViSolve Date: July 30 2006