Merge ~hloeung/content-cache-charm:http2 into content-cache-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: db0b28597d4222adbf356ecf057c36263f8d6dc9
Merged at revision: 84b08ef9ea4bdabc07f60277f8af65b3cefcde89
Proposed branch: ~hloeung/content-cache-charm:http2
Merge into: content-cache-charm:master
Diff against target: 102 lines (+14/-1)
9 files modified
.gitignore (+1/-0)
reactive/content_cache.py (+4/-0)
templates/sysctl_conf.tmpl (+3/-0)
tests/unit/files/sysctl_core_default_qdisc.conf (+1/-0)
tests/unit/files/sysctl_core_default_qdisc_none.conf (+1/-0)
tests/unit/files/sysctl_net_tcp_congestion_control.conf (+1/-0)
tests/unit/files/sysctl_net_tcp_congestion_control_bbr2.conf (+1/-0)
tests/unit/files/sysctl_net_tcp_congestion_control_no_bbr.conf (+1/-0)
tox.ini (+1/-1)
Reviewer Review Type Date Requested Status
Barry Price Approve
Canonical IS Reviewers Pending
Review via email: mp+403161@code.launchpad.net

Commit message

Set/lower tcp_notsent_lowat to optimise HTTP/2 prioritisation.

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
Barry Price (barryprice) wrote :

LGTM +1

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

Change successfully merged at revision 84b08ef9ea4bdabc07f60277f8af65b3cefcde89

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index c740bf5..4ee9909 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -8,5 +8,6 @@
6 __pycache__/
7 builds/
8 deps/
9+htmlcov/
10 repo-info
11 revision
12diff --git a/reactive/content_cache.py b/reactive/content_cache.py
13index d396779..93c72ca 100644
14--- a/reactive/content_cache.py
15+++ b/reactive/content_cache.py
16@@ -488,6 +488,10 @@ def configure_sysctl():
17 congestion_control = 'bbr'
18 context['net_ipv4_tcp_congestion_control'] = congestion_control
19
20+ # Set or lower tcp_notsent_lowat to optimise HTTP/2 prioritisation.
21+ # https://blog.cloudflare.com/http-2-prioritization-with-nginx/
22+ context['net_ipv4_tcp_notsent_lowat'] = '16384'
23+
24 base = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
25 env = jinja2.Environment(loader=jinja2.FileSystemLoader(base))
26 template = env.get_template('templates/sysctl_conf.tmpl')
27diff --git a/templates/sysctl_conf.tmpl b/templates/sysctl_conf.tmpl
28index a9f65f8..8904c5a 100644
29--- a/templates/sysctl_conf.tmpl
30+++ b/templates/sysctl_conf.tmpl
31@@ -2,6 +2,9 @@
32 # Taken from main Ubuntu Archive servers. Mostly for dealing with LFP.
33 net.ipv4.tcp_congestion_control={{ net_ipv4_tcp_congestion_control }}
34 {% endif -%}
35+{% if net_ipv4_tcp_notsent_lowat -%}
36+net.ipv4.tcp_notsent_lowat = {{ net_ipv4_tcp_notsent_lowat }}
37+{% endif -%}
38 {% if net_core_default_qdisc -%}
39 net.core.default_qdisc={{ net_core_default_qdisc }}
40 {% endif %}
41diff --git a/tests/unit/files/sysctl_core_default_qdisc.conf b/tests/unit/files/sysctl_core_default_qdisc.conf
42index c043b68..4cf9e97 100644
43--- a/tests/unit/files/sysctl_core_default_qdisc.conf
44+++ b/tests/unit/files/sysctl_core_default_qdisc.conf
45@@ -1,3 +1,4 @@
46+net.ipv4.tcp_notsent_lowat = 16384
47 net.core.default_qdisc=fq
48
49
50diff --git a/tests/unit/files/sysctl_core_default_qdisc_none.conf b/tests/unit/files/sysctl_core_default_qdisc_none.conf
51index 3712507..b324a4d 100644
52--- a/tests/unit/files/sysctl_core_default_qdisc_none.conf
53+++ b/tests/unit/files/sysctl_core_default_qdisc_none.conf
54@@ -1,3 +1,4 @@
55+net.ipv4.tcp_notsent_lowat = 16384
56
57
58 # Tune the TCP stack for Fast Failure Detection
59diff --git a/tests/unit/files/sysctl_net_tcp_congestion_control.conf b/tests/unit/files/sysctl_net_tcp_congestion_control.conf
60index fc5e418..bfebc3a 100644
61--- a/tests/unit/files/sysctl_net_tcp_congestion_control.conf
62+++ b/tests/unit/files/sysctl_net_tcp_congestion_control.conf
63@@ -1,5 +1,6 @@
64 # Taken from main Ubuntu Archive servers. Mostly for dealing with LFP.
65 net.ipv4.tcp_congestion_control=bbr
66+net.ipv4.tcp_notsent_lowat = 16384
67 net.core.default_qdisc=fq
68
69
70diff --git a/tests/unit/files/sysctl_net_tcp_congestion_control_bbr2.conf b/tests/unit/files/sysctl_net_tcp_congestion_control_bbr2.conf
71index b3c31d7..562e554 100644
72--- a/tests/unit/files/sysctl_net_tcp_congestion_control_bbr2.conf
73+++ b/tests/unit/files/sysctl_net_tcp_congestion_control_bbr2.conf
74@@ -1,5 +1,6 @@
75 # Taken from main Ubuntu Archive servers. Mostly for dealing with LFP.
76 net.ipv4.tcp_congestion_control=bbr2
77+net.ipv4.tcp_notsent_lowat = 16384
78 net.core.default_qdisc=fq
79
80
81diff --git a/tests/unit/files/sysctl_net_tcp_congestion_control_no_bbr.conf b/tests/unit/files/sysctl_net_tcp_congestion_control_no_bbr.conf
82index c043b68..4cf9e97 100644
83--- a/tests/unit/files/sysctl_net_tcp_congestion_control_no_bbr.conf
84+++ b/tests/unit/files/sysctl_net_tcp_congestion_control_no_bbr.conf
85@@ -1,3 +1,4 @@
86+net.ipv4.tcp_notsent_lowat = 16384
87 net.core.default_qdisc=fq
88
89
90diff --git a/tox.ini b/tox.ini
91index 44e08eb..2e48886 100644
92--- a/tox.ini
93+++ b/tox.ini
94@@ -11,7 +11,7 @@ setenv =
95 [testenv:unit]
96 commands =
97 pytest --ignore {toxinidir}/tests/functional \
98- {posargs:-v --cov=lib --cov=reactive --cov=actions --cov-report=term-missing --cov-branch}
99+ {posargs:-v --cov=lib --cov=reactive --cov=actions --cov-branch --cov-report=term-missing --cov-report=html}
100 deps = -r{toxinidir}/tests/unit/requirements.txt
101 -r{toxinidir}/requirements.txt
102 setenv =

Subscribers

People subscribed via source and target branches