From 0df9bbb4d75adc5186b091be94573e4002024d3f Mon Sep 17 00:00:00 2001 From: doktornotor Date: Fri, 25 Sep 2015 13:58:34 +0200 Subject: squid3 - code style fixes, improve descriptions, sanitize defaults --- config/squid3/34/squid_cache.xml | 292 ++++++++++++++++++++++++++------------- 1 file changed, 197 insertions(+), 95 deletions(-) (limited to 'config/squid3/34/squid_cache.xml') diff --git a/config/squid3/34/squid_cache.xml b/config/squid3/34/squid_cache.xml index 3b2cd406..6785fbb7 100755 --- a/config/squid3/34/squid_cache.xml +++ b/config/squid3/34/squid_cache.xml @@ -2,56 +2,51 @@ - - +. - All rights reserved. - */ -/* ========================================================================== */ + squid_cache.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2012-2014 Marcello Coutinho + Copyright (C) 2015 ESF, LLC + All rights reserved. +*/ +/* ====================================================================================== */ /* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 1. Redistributions of source code MUST retain the above copyright notice, - this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - 2. Redistributions in binary form MUST reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ -/* ========================================================================== */ - ]]> - - Describe your package here - Describe your package requirements here - Currently there are no FAQ items provided. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + squidcache - none - Proxy server: Cache management + 0.3.5 + Proxy Server: Cache management /usr/local/pkg/squid.inc - + General /pkg_edit.php?xml=squid.xml&id=0 @@ -85,7 +80,7 @@ /pkg.php?xml=squid_users.xml - Real time + Real Time /squid_monitor.php @@ -99,78 +94,120 @@ listtopic - Cache replacement policy + Cache Replacement Policy cache_replacement_policy - The cache replacement policy decides which objects will remain in cache and which objects are replaced to create space for the new objects. The default policy for cache replacement is LFUDA. Please see the type descriptions specified in the memory replacement policy for additional detail. + +
+ Heap LFUDA: Keeps popular objects in cache regardless of their size and thus optimizes byte hit rate at the expense of hit rate.
+ Heap GDSF: Optimizes object-hit rate by keeping smaller, popular objects in cache.
+ Heap LRU: Works like LRU, but uses a heap instead.
+ LRU: Keeps recently referenced objects (i.e., replaces the object that has not been accessed for the longest time).
+ Please see cache_replacement_policy documentation for additional details.

+ Default: heap LFUDA + ]]> +
select heap LFUDA - +
- Low-water-mark in % + Low-Water Mark in % cache_swap_low - Cache replacement begins when the swap usage is above the low-low-water mark and attempts to maintain utilisation near the low-water-mark. + + + Cache replacement begins when the swap usage is above this low-water mark and attempts to maintain utilisation near the low-water mark.
+ Please see cache_swap_low documentation for additional details.
+ ]]> +
input 5 90
- High-water-mark in % + High-Water Mark in % cache_swap_high - As swap utilisation gets close to the high-water-mark object eviction becomes more aggressive. + + + As swap utilization increases towards this high-water mark, object eviction becomes more agressive.
+ Please see cache_swap_high documentation for additional details.
+ ]]> +
input 5 95
- Do not cache + Do Not Cache donotcache - Enter each domain or IP address on a new line that should never be cached. + + + Note: Put each entry on a separate line. + ]]> + textarea 50 5 base64 - Enable offline mode + Enable Offline Mode enable_offline - Enable this option and the proxy server will never try to validate cached objects. The offline mode gives access to more cached information than the proposed feature would allow (stale cached versions, where the origin server should have been contacted). + + + Offline mode gives access to more cached information than normally allowed (e.g., expired cached versions where the origin server should have been contacted otherwise). + ]]> + checkbox - External Cache-Managers + External Cache Managers ext_cachemanager - Enter the IPs for the external Cache Managers to be allowed here, separated by semi-colons (;). + + Cache Managers to be granted access to this proxy. + Note: Separate entries by semi-colons (;) + ]]> + input 60 - Squid Hard disk cacheSettings + Squid Hard Disk Cache Settings listtopic - Hard disk cache size + Hard Disk Cache Size harddisk_cache_size - This is the amount of disk space (in megabytes) to use for cached objects. + Amount of disk space (in megabytes) to use for cached objects. input 10 100 - Hard disk cache system + Hard Disk Cache System harddisk_cache_system -
ufs is the old well-known Squid storage format that has always been there. -

aufs uses POSIX-threads to avoid blocking the main Squid process on disk-I/O. (Formerly known as async-io.) -

diskd uses a separate process to avoid blocking the main Squid process on disk-I/O.
To use ipcs and ipcrm on squid, Download livefs.iso from ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/8.3/ mount it and copy /usr/bin/ipcs and /usr/bin/ipcrm to your system and set them as executables. -

null Does not use any storage. Ideal for Embedded/NanoBSD.]]>
+ +
+ ufs - the old well-known Squid storage format that has always been there.
+ aufs - uses POSIX threads to avoid blocking the main Squid process on disk I/O. (Formerly known as async-io.)
+ diskd - uses a separate process to avoid blocking the main Squid process on disk I/O.
+ null - does not use any storage. Ideal for Embedded/NanoBSD.

+ Please see cache_dir documentation for additional details. + ]]> +
select ufs @@ -181,16 +218,25 @@
- Clear cache on log rotate + Clear Cache on Log Rotate clear_cache - - This action will be executed automatically if the swap.state file is taking up more than 75% disk space,or the drive is 90%]]> + + + Note: This action will be executed automatically if the swap.state file is taking up more than 75% of available space, or the filesystem is 90% full. + ]]> + checkbox - Level 1 subdirectories + Level 1 Directories level1_subdirs - 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. This will significantly slow down the startup process of the proxy service, but can speed up the caching under certain conditions. + + + This will significantly slow down the startup process of the proxy service, but can speed up the caching under certain conditions. + ]]> + select 16 @@ -204,27 +250,44 @@ - Hard disk cache location + Hard Disk Cache Location harddisk_cache_location - This is the directory where the cache will be stored. (note: do not end with a /). If you change this location, squid needs to make a new cache, this could take a while + + + Default: /var/squid/cache
+ Note: Do NOT include the trailing / when setting a custom location. + ]]> +
input 60 /var/squid/cache
- Minimum object size + Minimum Object Size minimum_object_size - Objects smaller than the size specified (in kilobytes) will not be saved on disk. The default value is 0, meaning there is no minimum. + + + Default: 0 (meaning there is no minimum) + ]]> + input 10 0 - Maximum object size + Maximum Object Size maximum_object_size - Objects larger than the size specified (in kilobytes) will not be saved on disk. If you wish to increase speed more than you want to save bandwidth, this should be set to a low value. + + + Hint: If increased speed is more important than saving bandwidth, this should be set to a low value.
+ Default: 4 (MB) + ]]> +
input 10 @@ -235,34 +298,56 @@ listtopic
- Memory cache size + Memory Cache Size memory_cache_size - This is the amount of physical RAM (in megabytes) to be used for negative cache and in-transit objects. This value should not exceed more than 50% of the installed RAM. The minimum value is 1MB. + + + Please see cache_mem documentation for additional details.
+ This value should not exceed 50% of the installed RAM. The minimum value is 1MB.

+ Default: 64 (MB) + ]]> +
input 10 - 8 + 64
- Maximum object size in RAM + Maximum Object Size in RAM maximum_objsize_in_mem - Objects smaller than the size specified (in kilobytes) will be saved in RAM. Default is 32. + + + Default: 256 (KB) + ]]> + input 10 - 32 + 256 - Memory replacement policy + Memory Replacement Policy memory_replacement_policy - The memory replacement policy determines which objects are purged from memory when space is needed. The default policy for memory replacement is GDSF. <p> <b> LRU: Last Recently Used Policy </b> - The LRU policies keep recently referenced objects. i.e., it replaces the object that has not been accessed for the longest time. <p> <b> Heap GDSF: Greedy-Dual Size Frequency </b> - The Heap GDSF policy optimizes object-hit rate by keeping smaller, popular objects in cache. It achieves a lower byte hit rate than LFUDA though, since it evicts larger (possibly popular) objects. <p> <b> Heap LFUDA: Least Frequently Used with Dynamic Aging </b> - 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. <p> <b> Heap LRU: Last Recently Used </b> - Works like LRU, but uses a heap instead. <p> Note: If using the LFUDA replacement policy, the value of Maximum Object Size should be increased above its default of 12KB to maximize the potential byte hit rate improvement of LFUDA. + +
+ Heap GDSF: Optimizes object-hit rate by keeping smaller, popular objects in cache.
+ Heap LFUDA: Keeps popular objects in cache regardless of their size and thus optimizes byte hit rate at the expense of hit rate.
+ Heap LRU: Works like LRU, but uses a heap instead.
+ LRU: Keeps recently referenced objects (i.e., replaces the object that has not been accessed for the longest time).
+ Please see cache_replacement_policy documentation for additional details.

+ Default: heap GDSF + ]]> +
select heap GDSF - - + +
@@ -272,18 +357,25 @@ Cache Dynamic Content cache_dynamic_content - enable caching of dynamic content.
- ]]>
+ + enable caching of dynamic content.
+ ]]> +
checkbox 10
Refresh Patterns refresh_patterns - windowsupdate
-
Notes:
- Squid wiki suggests 'Finish transfer if less than x KB remaining' on 'traffic mgmt' squid tab to -1 but you can apply your own values to control cache.

- set Maximum download size on 'traffic mgmt' squid tab to a value that fits patterns your are applying.
Microsoft may need 200Mb and youtube 4GB.]]>
+ + Windows Updates

+ Notes:
+ - Squid wiki suggests setting 'Finish transfer if less than x KB remaining' on 'Traffic Mgmt' tab to -1 (but you can apply your own values to control cache).
+ - Set 'Maximum Download Size' on 'Traffic Mgmt' tab to a value that fits patterns your are applying. + ]]> +
select none @@ -294,12 +386,17 @@ - 06 + 05
Custom refresh_patterns custom_refresh_patterns - Enter custom refresh_patterns for better dynamic cache. This options will be included only if dynamic cache is enabled. + + + Note: These refresh_patterns will only be included if 'Cache Dynamic Content' is enabled. + ]]> + textarea 67 5 @@ -307,16 +404,21 @@ - if($_POST['harddisk_cache_size'] != $config['installedpackages']['squidcache']['config'][0]['harddisk_cache_size']) { + squid_validate_cache($_POST, $input_errors); +
-- cgit v1.2.3