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
diff --git a/.gitignore b/.gitignore
index c740bf5..4ee9909 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,5 +8,6 @@
8__pycache__/8__pycache__/
9builds/9builds/
10deps/10deps/
11htmlcov/
11repo-info12repo-info
12revision13revision
diff --git a/reactive/content_cache.py b/reactive/content_cache.py
index d396779..93c72ca 100644
--- a/reactive/content_cache.py
+++ b/reactive/content_cache.py
@@ -488,6 +488,10 @@ def configure_sysctl():
488 congestion_control = 'bbr'488 congestion_control = 'bbr'
489 context['net_ipv4_tcp_congestion_control'] = congestion_control489 context['net_ipv4_tcp_congestion_control'] = congestion_control
490490
491 # Set or lower tcp_notsent_lowat to optimise HTTP/2 prioritisation.
492 # https://blog.cloudflare.com/http-2-prioritization-with-nginx/
493 context['net_ipv4_tcp_notsent_lowat'] = '16384'
494
491 base = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))495 base = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
492 env = jinja2.Environment(loader=jinja2.FileSystemLoader(base))496 env = jinja2.Environment(loader=jinja2.FileSystemLoader(base))
493 template = env.get_template('templates/sysctl_conf.tmpl')497 template = env.get_template('templates/sysctl_conf.tmpl')
diff --git a/templates/sysctl_conf.tmpl b/templates/sysctl_conf.tmpl
index a9f65f8..8904c5a 100644
--- a/templates/sysctl_conf.tmpl
+++ b/templates/sysctl_conf.tmpl
@@ -2,6 +2,9 @@
2# Taken from main Ubuntu Archive servers. Mostly for dealing with LFP.2# Taken from main Ubuntu Archive servers. Mostly for dealing with LFP.
3net.ipv4.tcp_congestion_control={{ net_ipv4_tcp_congestion_control }}3net.ipv4.tcp_congestion_control={{ net_ipv4_tcp_congestion_control }}
4{% endif -%}4{% endif -%}
5{% if net_ipv4_tcp_notsent_lowat -%}
6net.ipv4.tcp_notsent_lowat = {{ net_ipv4_tcp_notsent_lowat }}
7{% endif -%}
5{% if net_core_default_qdisc -%}8{% if net_core_default_qdisc -%}
6net.core.default_qdisc={{ net_core_default_qdisc }}9net.core.default_qdisc={{ net_core_default_qdisc }}
7{% endif %}10{% endif %}
diff --git a/tests/unit/files/sysctl_core_default_qdisc.conf b/tests/unit/files/sysctl_core_default_qdisc.conf
index c043b68..4cf9e97 100644
--- a/tests/unit/files/sysctl_core_default_qdisc.conf
+++ b/tests/unit/files/sysctl_core_default_qdisc.conf
@@ -1,3 +1,4 @@
1net.ipv4.tcp_notsent_lowat = 16384
1net.core.default_qdisc=fq2net.core.default_qdisc=fq
23
34
diff --git a/tests/unit/files/sysctl_core_default_qdisc_none.conf b/tests/unit/files/sysctl_core_default_qdisc_none.conf
index 3712507..b324a4d 100644
--- a/tests/unit/files/sysctl_core_default_qdisc_none.conf
+++ b/tests/unit/files/sysctl_core_default_qdisc_none.conf
@@ -1,3 +1,4 @@
1net.ipv4.tcp_notsent_lowat = 16384
12
23
3# Tune the TCP stack for Fast Failure Detection4# Tune the TCP stack for Fast Failure Detection
diff --git a/tests/unit/files/sysctl_net_tcp_congestion_control.conf b/tests/unit/files/sysctl_net_tcp_congestion_control.conf
index fc5e418..bfebc3a 100644
--- a/tests/unit/files/sysctl_net_tcp_congestion_control.conf
+++ b/tests/unit/files/sysctl_net_tcp_congestion_control.conf
@@ -1,5 +1,6 @@
1# Taken from main Ubuntu Archive servers. Mostly for dealing with LFP.1# Taken from main Ubuntu Archive servers. Mostly for dealing with LFP.
2net.ipv4.tcp_congestion_control=bbr2net.ipv4.tcp_congestion_control=bbr
3net.ipv4.tcp_notsent_lowat = 16384
3net.core.default_qdisc=fq4net.core.default_qdisc=fq
45
56
diff --git a/tests/unit/files/sysctl_net_tcp_congestion_control_bbr2.conf b/tests/unit/files/sysctl_net_tcp_congestion_control_bbr2.conf
index b3c31d7..562e554 100644
--- a/tests/unit/files/sysctl_net_tcp_congestion_control_bbr2.conf
+++ b/tests/unit/files/sysctl_net_tcp_congestion_control_bbr2.conf
@@ -1,5 +1,6 @@
1# Taken from main Ubuntu Archive servers. Mostly for dealing with LFP.1# Taken from main Ubuntu Archive servers. Mostly for dealing with LFP.
2net.ipv4.tcp_congestion_control=bbr22net.ipv4.tcp_congestion_control=bbr2
3net.ipv4.tcp_notsent_lowat = 16384
3net.core.default_qdisc=fq4net.core.default_qdisc=fq
45
56
diff --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
index c043b68..4cf9e97 100644
--- a/tests/unit/files/sysctl_net_tcp_congestion_control_no_bbr.conf
+++ b/tests/unit/files/sysctl_net_tcp_congestion_control_no_bbr.conf
@@ -1,3 +1,4 @@
1net.ipv4.tcp_notsent_lowat = 16384
1net.core.default_qdisc=fq2net.core.default_qdisc=fq
23
34
diff --git a/tox.ini b/tox.ini
index 44e08eb..2e48886 100644
--- a/tox.ini
+++ b/tox.ini
@@ -11,7 +11,7 @@ setenv =
11[testenv:unit]11[testenv:unit]
12commands = 12commands =
13 pytest --ignore {toxinidir}/tests/functional \13 pytest --ignore {toxinidir}/tests/functional \
14 {posargs:-v --cov=lib --cov=reactive --cov=actions --cov-report=term-missing --cov-branch}14 {posargs:-v --cov=lib --cov=reactive --cov=actions --cov-branch --cov-report=term-missing --cov-report=html}
15deps = -r{toxinidir}/tests/unit/requirements.txt15deps = -r{toxinidir}/tests/unit/requirements.txt
16 -r{toxinidir}/requirements.txt16 -r{toxinidir}/requirements.txt
17setenv =17setenv =

Subscribers

People subscribed via source and target branches