Merge lp:~hloeung/ubuntu-repository-cache/cache-memory-tuning-2 into lp:ubuntu-repository-cache

Proposed by Haw Loeung
Status: Merged
Merged at revision: 291
Proposed branch: lp:~hloeung/ubuntu-repository-cache/cache-memory-tuning-2
Merge into: lp:ubuntu-repository-cache
Prerequisite: lp:~hloeung/ubuntu-repository-cache/cache-memory-tuning
Diff against target: 41 lines (+5/-4)
2 files modified
lib/ubuntu_repository_cache/squid.py (+2/-1)
lib/ubuntu_repository_cache/tests/test_squid.py (+3/-3)
To merge this branch: bzr merge lp:~hloeung/ubuntu-repository-cache/cache-memory-tuning-2
Reviewer Review Type Date Requested Status
Canonical IS Reviewers Pending
Ubuntu Repository Cache Charmers, Canonical Pending
Review via email: mp+394928@code.launchpad.net

Commit message

Tune squid cache memory usage reducing from 33% to 30%

To post a comment you must log in.
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 :

Unable to determine commit message from repository - please click "Set commit message" and enter the commit message manually.

292. By Haw Loeung

Tune squid cache memory usage reducing from 33% to 30%

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/ubuntu_repository_cache/squid.py'
2--- lib/ubuntu_repository_cache/squid.py 2020-12-07 03:16:34 +0000
3+++ lib/ubuntu_repository_cache/squid.py 2020-12-07 03:16:35 +0000
4@@ -48,7 +48,8 @@
5 memory = system_total_memory
6 if not system_total_memory:
7 memory = util.system_total_mem()
8- memory = memory / 3
9+ # Set aside 30% of system memory for squid memory cache.
10+ memory = memory * 0.30
11 # Estimate of 100MB of overhead for squid
12 memory = max(memory - 100, 0)
13
14
15=== modified file 'lib/ubuntu_repository_cache/tests/test_squid.py'
16--- lib/ubuntu_repository_cache/tests/test_squid.py 2020-12-07 03:16:34 +0000
17+++ lib/ubuntu_repository_cache/tests/test_squid.py 2020-12-07 03:16:35 +0000
18@@ -53,7 +53,7 @@
19 'cache-memory-size': 0,
20 }
21 result = squid.cache_mem(13997)
22- self.assertEqual(result, 'cache_mem 3588 MB')
23+ self.assertEqual(result, 'cache_mem 3122 MB')
24
25 # 7GB per Azure D2_v2. 50GB cache, auto calculate memory usage.
26 self.mock_config.return_value = {
27@@ -61,7 +61,7 @@
28 'cache-memory-size': 0,
29 }
30 result = squid.cache_mem(6954)
31- self.assertEqual(result, 'cache_mem 1241 MB')
32+ self.assertEqual(result, 'cache_mem 1009 MB')
33
34 # 7GB per Azure D2_v2. 50GB cache, fixed 1000 MB.
35 self.mock_config.return_value = {
36@@ -78,4 +78,4 @@
37 'cache-memory-size': 0,
38 }
39 result = squid.cache_mem(6954)
40- self.assertEqual(result, 'cache_mem 1241 MB')
41+ self.assertEqual(result, 'cache_mem 1009 MB')

Subscribers

People subscribed via source and target branches