aboutsummaryrefslogtreecommitdiffstats
path: root/packages/squid
diff options
context:
space:
mode:
authorMartin Fuchs <mfuchs@pfsense.org>2008-08-11 20:53:46 +0000
committerMartin Fuchs <mfuchs@pfsense.org>2008-08-11 20:53:46 +0000
commit51121fbed4e4eb00e06c7abc62988abe4068f159 (patch)
treef9f42a4ef534be8f3f17440ff8c1d3920e2137b8 /packages/squid
parent3ebbf29b8cf7201a445d4b9108efdff71ae63595 (diff)
downloadpfsense-packages-51121fbed4e4eb00e06c7abc62988abe4068f159.tar.gz
pfsense-packages-51121fbed4e4eb00e06c7abc62988abe4068f159.tar.bz2
pfsense-packages-51121fbed4e4eb00e06c7abc62988abe4068f159.zip
squid: introduce low- and hugi-water-marks for better cache tuning
Diffstat (limited to 'packages/squid')
-rw-r--r--packages/squid/squid.inc6
-rw-r--r--packages/squid/squid_cache.xml14
2 files changed, 20 insertions, 0 deletions
diff --git a/packages/squid/squid.inc b/packages/squid/squid.inc
index 94d50cf9..4b3e3b05 100644
--- a/packages/squid/squid.inc
+++ b/packages/squid/squid.inc
@@ -539,6 +539,10 @@ function squid_resync_cache() {
$min_objsize = ($settings['minimum_object_size'] ? $settings['minimum_object_size'] : 0);
$cache_policy = ($settings['cache_replacement_policy'] ? $settings['cache_replacement_policy'] : 'heap LFUDA');
$memory_policy = ($settings['memory_replacement_policy'] ? $settings['memory_replacement_policy'] : 'heap GDSF');
+
+ $cache_swap_low = ($settings['cache_swap_low'] ? $settings['cache_swap_low'] : '90');
+ $cache_swap_high = ($settings['cache_swap_high'] ? $settings['cache_swap_high'] : '95');
+
$offline_mode = ($settings['enable_offline'] == 'on' ? 'on' : 'off');
$conf = <<<EOD
@@ -548,6 +552,8 @@ maximum_object_size $max_objsize KB
minimum_object_size $min_objsize KB
cache_replacement_policy $cache_policy
memory_replacement_policy $memory_policy
+cache_swap_low $cache_swap_low
+cache_swap_high $cache_swap_high
offline_mode $offline_mode
EOD;
diff --git a/packages/squid/squid_cache.xml b/packages/squid/squid_cache.xml
index 861f96b8..6f6c0388 100644
--- a/packages/squid/squid_cache.xml
+++ b/packages/squid/squid_cache.xml
@@ -165,6 +165,20 @@
</options>
</field>
<field>
+ <fielddescr>Low-water-mark in %</fielddescr>
+ <fieldname>cache_swap_low</fieldname>
+ <description>Cache replacement begins when the swap usage is above the low-low-water mark and attempts to maintain utilisation near the low-water-mark.</description>
+ <type>input</type>
+ <default_value>90</default_value>
+ </field>
+ <field>
+ <fielddescr>High-water-mark in %</fielddescr>
+ <fieldname>cache_swap_high</fieldname>
+ <description>As swap utilisation gets close to the high-water-mark object eviction becomes more aggressive.</description>
+ <type>input</type>
+ <default_value>95</default_value>
+ </field>
+ <field>
<fielddescr>Do not cache</fielddescr>
<fieldname>donotcache</fieldname>
<description>Enter each domain or IP address on a new line that should never be cached.</description>