Merge lp:~hloeung/ubuntu-repository-cache/drop-max-spare-threads into lp:ubuntu-repository-cache

Proposed by Haw Loeung
Status: Work in progress
Proposed branch: lp:~hloeung/ubuntu-repository-cache/drop-max-spare-threads
Merge into: lp:ubuntu-repository-cache
Diff against target: 65 lines (+6/-6)
3 files modified
lib/ubuntu_repository_cache/apache.py (+1/-1)
lib/ubuntu_repository_cache/tests/test_apache.py (+4/-4)
tests/unit/test_apache.py (+1/-1)
To merge this branch: bzr merge lp:~hloeung/ubuntu-repository-cache/drop-max-spare-threads
Reviewer Review Type Date Requested Status
Canonical IS Reviewers Pending
Ubuntu Repository Cache Charmers Pending
Review via email: mp+399560@code.launchpad.net

Commit message

Drop MaxSpareThreads - LP:1918211

We can't have too many around to allow for a server process to cycle
out. Otherwise we're back at the issue with scoreboard is full, not at
MaxRequestWorkers.

To post a comment you must log in.
Revision history for this message
Canonical IS Mergebot (canonical-is-mergebot) wrote :

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

Revision history for this message
Paul Collins (pjdc) wrote :

Doesn't this make for fewer spare threads? (As the test-case updates seem to imply.)

I'd be interested to wait and see if the extra process is enough by itself.

Right now I would expect that as process A is gracefulling and marking its scoreboard entries as unusable, process B will take requests and spawn more threads if needed up to MaxSpareThreads.

Revision history for this message
Haw Loeung (hloeung) wrote :

> Doesn't this make for fewer spare threads? (As the test-case updates seem to
> imply.)

It makes it back to the no. of spare threads before the change to add an additional server process (ServerLimit 2 rather than 1). We still keep a bunch of spare threads, enough or max. for a single process.

> I'd be interested to wait and see if the extra process is enough by itself.
>
> Right now I would expect that as process A is gracefulling and marking its
> scoreboard entries as unusable, process B will take requests and spawn more
> threads if needed up to MaxSpareThreads.

Sure, marking this as WIP for the moment so we can see how the extra process is doing.

Revision history for this message
Haw Loeung (hloeung) wrote :

> > Doesn't this make for fewer spare threads? (As the test-case updates seem to
> > imply.)
>
> It makes it back to the no. of spare threads before the change to add an
> additional server process (ServerLimit 2 rather than 1). We still keep a bunch
> of spare threads, enough or max. for a single process.

That's from https://code.launchpad.net/~hloeung/ubuntu-repository-cache/extra-server-process/+merge/399536

Revision history for this message
Paul Collins (pjdc) wrote :

> > > Doesn't this make for fewer spare threads? (As the test-case updates seem
> to
> > > imply.)
> >
> > It makes it back to the no. of spare threads before the change to add an
> > additional server process (ServerLimit 2 rather than 1). We still keep a
> bunch
> > of spare threads, enough or max. for a single process.
>
> That's from https://code.launchpad.net/~hloeung/ubuntu-repository-cache/extra-
> server-process/+merge/399536

Ah, I see. Thanks!

Unmerged revisions

333. By Haw Loeung

Drop MaxSpareThreads - LP:1918211

We can't have too many around to allow for a server process to cycle
out. Otherwise we're back at the issue with scoreboard is full, not at
MaxRequestWorkers.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/ubuntu_repository_cache/apache.py'
2--- lib/ubuntu_repository_cache/apache.py 2021-03-11 23:09:11 +0000
3+++ lib/ubuntu_repository_cache/apache.py 2021-03-12 03:05:02 +0000
4@@ -122,7 +122,7 @@
5 config['minsparethreads'] = int(config['maxrequestworkers'] * 0.5)
6
7 if not config['maxsparethreads']:
8- config['maxsparethreads'] = config['maxrequestworkers']
9+ config['maxsparethreads'] = config['minsparethreads']
10
11 return config
12
13
14=== modified file 'lib/ubuntu_repository_cache/tests/test_apache.py'
15--- lib/ubuntu_repository_cache/tests/test_apache.py 2021-03-11 23:09:11 +0000
16+++ lib/ubuntu_repository_cache/tests/test_apache.py 2021-03-12 03:05:02 +0000
17@@ -39,7 +39,7 @@
18 expected = {
19 'startservers': 1,
20 'minsparethreads': 1024,
21- 'maxsparethreads': 2048,
22+ 'maxsparethreads': 1024,
23 'threadlimit': 1024,
24 'threadsperchild': 1024,
25 'serverlimit': 2,
26@@ -62,7 +62,7 @@
27 expected = {
28 'startservers': 1,
29 'minsparethreads': 1280,
30- 'maxsparethreads': 2560,
31+ 'maxsparethreads': 1280,
32 'threadlimit': 1280,
33 'threadsperchild': 1280,
34 'serverlimit': 2,
35@@ -85,7 +85,7 @@
36 expected = {
37 'startservers': 1,
38 'minsparethreads': 256,
39- 'maxsparethreads': 512,
40+ 'maxsparethreads': 256,
41 'threadlimit': 256,
42 'threadsperchild': 256,
43 'serverlimit': 2,
44@@ -108,7 +108,7 @@
45 expected = {
46 'startservers': 1,
47 'minsparethreads': 512,
48- 'maxsparethreads': 1024,
49+ 'maxsparethreads': 512,
50 'threadlimit': 512,
51 'threadsperchild': 512,
52 'serverlimit': 2,
53
54=== modified file 'tests/unit/test_apache.py'
55--- tests/unit/test_apache.py 2021-03-11 23:09:11 +0000
56+++ tests/unit/test_apache.py 2021-03-12 03:05:02 +0000
57@@ -239,7 +239,7 @@
58 {
59 'maxconnectionsperchild': 10000,
60 'maxrequestworkers': 1024,
61- 'maxsparethreads': 1024,
62+ 'maxsparethreads': 512,
63 'minsparethreads': 512,
64 'serverlimit': 2,
65 'startservers': 1,

Subscribers

People subscribed via source and target branches