User Tools

Site Tools


pfsense:squid:options_which_affect_the_cache

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pfsense:squid:options_which_affect_the_cache [2020/03/30 09:51] – [Maximum Object Size] peterpfsense:squid:options_which_affect_the_cache [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 22: Line 22:
 ---- ----
  
-===== Low-Water Mark in % =====+===== Low-Water Mark in % (cache_swap_low) =====
  
 The low-water mark for AUFS/UFS/diskd cache object eviction by the cache_replacement_policy algorithm. The low-water mark for AUFS/UFS/diskd cache object eviction by the cache_replacement_policy algorithm.
  
   * Default: **90**.   * Default: **90**.
- 
  
 This defines when the replacement should take place. This defines when the replacement should take place.
Line 37: Line 36:
 If utilization is close to the low-water mark less replacement is done each time. 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.+<WRAP important> 
 +**WARNING:**  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. 
 +</WRAP> 
  
 ---- ----
  
-===== High-Water Mark in % =====+===== High-Water Mark in % (cache_swap_high) =====
  
 The high-water mark for AUFS/UFS/diskd cache object eviction by the cache_replacement_policy algorithm. The high-water mark for AUFS/UFS/diskd cache object eviction by the cache_replacement_policy algorithm.
Line 55: Line 57:
 If utilization is close to the low-water mark less replacement is done each time. 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.+<WRAP important> 
 +**WARNING:**  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. 
 +</WRAP> 
  
 ---- ----
Line 85: Line 90:
  
   * Default: **16**.   * Default: **16**.
 +  * My setting: **64**.
  
 Each level-1 directory contains 256 subdirectories, so a value of 256 level-1 directories will use a total of 65536 directories for the hard disk cache. Each level-1 directory contains 256 subdirectories, so a value of 256 level-1 directories will use a total of 65536 directories for the hard disk cache.
Line 129: Line 135:
  
   * Default is : **64MB**.   * Default is : **64MB**.
 +  * My setting: **2048**.
  
 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. 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.
Line 136: Line 143:
 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. 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.
  
-<WRAP info+|In-transit objects or current requests|These are the objects related to the current requests and they have the highest priority to be kept in the cache space in RAM.  These objects must be kept in RAM and if there is a situation where the incoming request rate is quite high and we are about to overflow the cache space in RAM, Squid will try to keep the served part (the part which has already been sent to the client) on the disk to create free space in RAM.| 
-**NOTE:**  This tag does not specify the maximum process size.+|Hot or popular objects|These objects or web documents are popular and are requested quite frequently compared to others.  These are stored in the cache space left after storing the in-transit objects as these have a lower priority than in-transit objects.  These objects are generally pushed to disk when there is a need to generate more in RAM cache space for storing the in-transit objects.| 
 +|Negatively cached objects|Negatively cached objects are error messages which Squid has encountered while fetching a page or web document on behalf of a client.  For example, if a request to a web page has resulted in a HTTP error 404 (page not found), and Squid receives a subsequent request for the same web page, then Squid will check if the response is still fresh and will return a reply from the cache itself.  If there is a request for the same page after the negatively cached object corresponding to that page has expired, Squid will check again if the page is available.  Negatively cached objects have the same priority as hot or popular objects and they can be pushed to disk at any time in favor of in-transit objects.| 
 + 
 + 
 + 
 + 
 +<WRAP important
 +**WARNING:**  This tag does not specify the maximum process size.
  
 It places a limit on one aspect of squid's memory usage. It places a limit on one aspect of squid's memory usage.
Line 144: Line 158:
  
 Process will probably become twice or three times bigger than the value put here. Process will probably become twice or three times bigger than the value put here.
 +
 +While deciding the RAM space for caching, we should be neither greedy nor paranoid.  If we specify a large percentage of RAM for caching, the overall system performance will suffer as the system will start swapping processes in case there is no free RAM left for other processes.  If we use a very low percentage of RAM for caching, then we’ll not be able to take full advantage of Squid’s caching mechanism.
 </WRAP> </WRAP>
  
Line 153: Line 169:
  
   * Default: **256 (KB)**.   * Default: **256 (KB)**.
 +  * My setting:  **1024**.
 +
  
 +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**.
  
 ---- ----
Line 161: Line 180:
 The memory replacement policy determines which objects are purged from memory when space is needed. The memory replacement policy determines which objects are purged from memory when space is needed.
  
-  * Default: **heap GDSF**.+  * Default: **Heap GDSF**. 
 +  * My setting: **Heap LFUDA**.
  
  
pfsense/squid/options_which_affect_the_cache.1585561917.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki