Merge lp:~hloeung/ubuntu-repository-cache/squid-cache-eviction-watermarks into lp:ubuntu-repository-cache

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: 343
Merged at revision: 343
Proposed branch: lp:~hloeung/ubuntu-repository-cache/squid-cache-eviction-watermarks
Merge into: lp:ubuntu-repository-cache
Diff against target: 84 lines (+34/-2)
5 files modified
.bzrignore (+1/-0)
charmcraft.yaml (+17/-0)
config.yaml (+12/-0)
lib/ubuntu_repository_cache/squid.py (+2/-0)
templates/squid-deb-proxy/squid-deb-proxy.conf (+2/-2)
To merge this branch: bzr merge lp:~hloeung/ubuntu-repository-cache/squid-cache-eviction-watermarks
Reviewer Review Type Date Requested Status
Paul Collins lgtm Approve
Canonical IS Reviewers Pending
Review via email: mp+423130@code.launchpad.net

Commit message

Allow overriding squid-cache's watermark thresholds (cache_swap_low & cache_swap_high) to tune memory usage

To post a comment you must log in.
Revision history for this message
Paul Collins (pjdc) :
review: Approve (lgtm)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 343

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2021-02-22 00:49:41 +0000
+++ .bzrignore 2022-05-23 03:31:53 +0000
@@ -10,6 +10,7 @@
10.tox/10.tox/
11.cache/11.cache/
12__pycache__/12__pycache__/
13build/
13builds/14builds/
14deps/15deps/
15repo-info16repo-info
1617
=== added file 'charmcraft.yaml'
--- charmcraft.yaml 1970-01-01 00:00:00 +0000
+++ charmcraft.yaml 2022-05-23 03:31:53 +0000
@@ -0,0 +1,17 @@
1type: "charm"
2bases:
3 - build-on:
4 - name: "ubuntu"
5 channel: "20.04"
6 - name: "ubuntu"
7 channel: "22.04"
8 run-on:
9 - name: "ubuntu"
10 channel: "20.04"
11 - name: "ubuntu"
12 channel: "22.04"
13parts:
14 charm:
15 source: .
16 plugin: reactive
17 build-snaps: [charm]
018
=== modified file 'config.yaml'
--- config.yaml 2021-03-09 04:28:19 +0000
+++ config.yaml 2022-05-23 03:31:53 +0000
@@ -83,6 +83,18 @@
83 description: |83 description: |
84 Configurable option (in MBytes) to tune/override storage used by84 Configurable option (in MBytes) to tune/override storage used by
85 squid cache. If 0 or unset, then auto-calculate.85 squid cache. If 0 or unset, then auto-calculate.
86 cache-swap-high:
87 default: 85
88 type: int
89 description: |
90 Configurable option to tune/override the high-water mark for cache object
91 eviction.
92 cache-swap-low:
93 default: 80
94 type: int
95 description: |
96 Configurable option to tune/override the low-water mark for cache object
97 eviction.
86 nagios_context:98 nagios_context:
87 default: 'juju'99 default: 'juju'
88 type: string100 type: string
89101
=== modified file 'lib/ubuntu_repository_cache/squid.py'
--- lib/ubuntu_repository_cache/squid.py 2021-03-10 00:53:26 +0000
+++ lib/ubuntu_repository_cache/squid.py 2022-05-23 03:31:53 +0000
@@ -196,6 +196,8 @@
196 context['Cache_Storage_Config'] = cache_dirs()196 context['Cache_Storage_Config'] = cache_dirs()
197 context['Cache_Peers'] = peer_config()197 context['Cache_Peers'] = peer_config()
198 context['Cache_Hostname'] = hookenv.unit_private_ip()198 context['Cache_Hostname'] = hookenv.unit_private_ip()
199 context['Cache_Swap_Low'] = config.get('cache-swap-low', 80)
200 context['Cache_Swap_High'] = config.get('cache-swap-high', 85)
199 if config['squid_snmp']:201 if config['squid_snmp']:
200 context[202 context[
201 'Snmp_Config'203 'Snmp_Config'
202204
=== modified file 'templates/squid-deb-proxy/squid-deb-proxy.conf'
--- templates/squid-deb-proxy/squid-deb-proxy.conf 2021-06-08 03:24:12 +0000
+++ templates/squid-deb-proxy/squid-deb-proxy.conf 2022-05-23 03:31:53 +0000
@@ -42,8 +42,8 @@
42{{ Cache_Storage_Config }}42{{ Cache_Storage_Config }}
4343
44# Cache swap more aggressive to avoid having the cache size going above the cache_dir size parameter44# Cache swap more aggressive to avoid having the cache size going above the cache_dir size parameter
45cache_swap_low 8045cache_swap_low {{ Cache_Swap_Low }}
46cache_swap_high 8546cache_swap_high {{ Cache_Swap_High }}
4747
48# use different logs48# use different logs
49cache_log /var/log/squid-deb-proxy/cache.log49cache_log /var/log/squid-deb-proxy/cache.log

Subscribers

People subscribed via source and target branches