Merge lp:~hloeung/ubuntu-repository-cache/limit-max-workers into lp:ubuntu-repository-cache

Proposed by Haw Loeung
Status: Merged
Approved by: Barry Price
Approved revision: 301
Merged at revision: 297
Proposed branch: lp:~hloeung/ubuntu-repository-cache/limit-max-workers
Merge into: lp:ubuntu-repository-cache
Diff against target: 33 lines (+8/-4)
2 files modified
config.yaml (+1/-1)
lib/ubuntu_repository_cache/apache.py (+7/-3)
To merge this branch: bzr merge lp:~hloeung/ubuntu-repository-cache/limit-max-workers
Reviewer Review Type Date Requested Status
Barry Price Approve
Canonical IS Reviewers Pending
Review via email: mp+396467@code.launchpad.net

Commit message

Cap the automatically calculated max. threads per child to 2560

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.

300. By Haw Loeung

Fixed description to hopefully make it clearer

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.

301. By Haw Loeung

[trivial] Line space change

Revision history for this message
Barry Price (barryprice) wrote :

LGTM

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

Change successfully merged at revision 297

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2020-12-07 00:54:07 +0000
+++ config.yaml 2021-01-19 04:31:43 +0000
@@ -132,7 +132,7 @@
132 default: 0132 default: 0
133 description: |133 description: |
134 Sets the upper limit on the configurable number of threads per134 Sets the upper limit on the configurable number of threads per
135 child process (0 means autocalculate)135 child process (0 means autocalculate with max. 2560; override here)
136 apache2_mpm_threadsperchild:136 apache2_mpm_threadsperchild:
137 type: int137 type: int
138 default: 0138 default: 0
139139
=== modified file 'lib/ubuntu_repository_cache/apache.py'
--- lib/ubuntu_repository_cache/apache.py 2020-11-02 03:11:28 +0000
+++ lib/ubuntu_repository_cache/apache.py 2021-01-19 04:31:43 +0000
@@ -88,9 +88,13 @@
88 # has but the ratio of vCPU to RAM between public clouds seems88 # has but the ratio of vCPU to RAM between public clouds seems
89 # good enough so this is not needed.89 # good enough so this is not needed.
90 config['threadsperchild'] = 256 * cpu_count90 config['threadsperchild'] = 256 * cpu_count
91 # Cap at 819291 # Cap at 2560. It's been observed in AWS, even though there
92 if config['threadsperchild'] > 8192:92 # are 36 vCPUs, VMs perform badly with over 2500 workers
93 config['threadsperchild'] = 819293 # (likely squid-deb-proxy bottleneck). But let's cap it here,
94 # someone can override it by setting the
95 # apache2_mpm_threadlimit charm config.
96 if config['threadsperchild'] > 2560:
97 config['threadsperchild'] = 2560
9498
95 if not config['threadlimit']:99 if not config['threadlimit']:
96 # Hard limit should match per child limit.100 # Hard limit should match per child limit.

Subscribers

People subscribed via source and target branches