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

Proposed by Haw Loeung on 2021-01-19
Status: Merged
Approved by: Barry Price on 2021-01-19
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 2021-01-19 Approve on 2021-01-19
Canonical IS Reviewers 2021-01-19 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.

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

300. By Haw Loeung on 2021-01-19

Fixed description to hopefully make it clearer

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

301. By Haw Loeung on 2021-01-19

[trivial] Line space change

Barry Price (barryprice) wrote :

LGTM

review: Approve

Change successfully merged at revision 297

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2020-12-07 00:54:07 +0000
3+++ config.yaml 2021-01-19 04:31:43 +0000
4@@ -132,7 +132,7 @@
5 default: 0
6 description: |
7 Sets the upper limit on the configurable number of threads per
8- child process (0 means autocalculate)
9+ child process (0 means autocalculate with max. 2560; override here)
10 apache2_mpm_threadsperchild:
11 type: int
12 default: 0
13
14=== modified file 'lib/ubuntu_repository_cache/apache.py'
15--- lib/ubuntu_repository_cache/apache.py 2020-11-02 03:11:28 +0000
16+++ lib/ubuntu_repository_cache/apache.py 2021-01-19 04:31:43 +0000
17@@ -88,9 +88,13 @@
18 # has but the ratio of vCPU to RAM between public clouds seems
19 # good enough so this is not needed.
20 config['threadsperchild'] = 256 * cpu_count
21- # Cap at 8192
22- if config['threadsperchild'] > 8192:
23- config['threadsperchild'] = 8192
24+ # Cap at 2560. It's been observed in AWS, even though there
25+ # are 36 vCPUs, VMs perform badly with over 2500 workers
26+ # (likely squid-deb-proxy bottleneck). But let's cap it here,
27+ # someone can override it by setting the
28+ # apache2_mpm_threadlimit charm config.
29+ if config['threadsperchild'] > 2560:
30+ config['threadsperchild'] = 2560
31
32 if not config['threadlimit']:
33 # Hard limit should match per child limit.

Subscribers

People subscribed via source and target branches