ubuntips

Removing HTTP/3 from nginx cost nothing

Draft posted on · 7 min read

On this page
Draft commented on Dec 2, 2026

My setup script compiles nginx from source with only the modules the sites need. Release 1.22.47 removes one more: HTTP/3, the QUIC module. This post covers why, what the upgrade does to existing servers, and the A/B that showed the change cost nothing.

Why HTTP/3 had to go#

Every origin I run sits behind Cloudflare. Visitors get HTTP/3 from Cloudflare’s edge, but Cloudflare reaches the origin over TCP, with HTTP/1.1 or HTTP/2. It never opens a QUIC connection to the origin. So the QUIC listeners on my servers served no real visitor. All they did was answer whatever probed UDP port 443.

That’s a module compiled into every nginx, a patch to keep in step with it, a UDP port open in the firewall, and listener options to tune, all for traffic that never arrives. The script also patches nginx’s header filters to remove the Server header, and the HTTP/3 filter was one of the three it had to patch. Now it patches two.

Leaving --with-http_v3_module out of the build doesn’t change the TCP request path. HTTP/1.1 and HTTP/2 don’t run any HTTP/3 code. I expected no difference in speed, but every change has to pass an A/B test, and an expectation isn’t a measurement.

What an upgrade does#

The build recipe moved from 7 to 8, so every server rebuilds nginx once on its next --optimize. Before the new binary is activated, the same run cleans the vhosts, because a vhost that still says listen 443 quic would fail nginx -t on a build without the module:

  • Lines my script added are deleted. Releases 1.22.5 to 1.22.46 put an include h5bp/tls/http3.conf; line in each vhost, with a marker comment. Those go, along with the commented-out copies that kept a vhost off HTTP/3 and an old comment about QUIC socket options.
  • Operator lines are commented out, not deleted. A hand-written listen ... quic, any http3* or quic_* directive, and add_header Alt-Svc become # setup.sh: HTTP/3 removed (1.22.47): .... Every *.conf under /etc/nginx is scanned except the certificate directory.
  • Nothing half-done is left behind. The edited tree must pass nginx -t with the running binary, or every file is put back and the report names them. In that case the new build stops at its own test and the old nginx keeps serving.

If a file still can’t be edited, the build’s fit step comments out the leftover http3* or quic_* lines when it activates the binary and adds a line to the report, instead of blocking the upgrade.

The firewall changed too. --basic now opens 80/tcp and 443/tcp only, and replaces the any-protocol 80 and 443 rules older releases added, which also opened UDP. --optimize still never touches the firewall, so an existing server keeps its old rule until --basic runs again. With nothing listening on UDP, that rule doesn’t expose anything.

The configuration templates followed in the same release. The catch-all server no longer has a QUIC listener (the one I added after the first site on HTTP/3 became everyone’s default). h5bp/tls/http3.conf is kept as an empty file, so an old include still passes, and the templates’ CI rejects any QUIC listen, http3* or quic_* directive, or Alt-Svc header.

On the Xeon E-2236 test host, --optimize from 1.22.46 to 1.22.47 took 3 min 28 s. The XenForo vhost lost only its two http3.conf includes. UDP 443 sockets went from 16 to 0, while TCP 443 and HTTP/2 stayed as they were, and an unknown name still got no certificate. A second --optimize changed nothing.

The A/B#

1.22.47 shipped with functional tests only. The cycle was paused for other work on the test host before the throughput A/B ran, and the changelog said so. I ran it during the next cycle.

The method:

  • Two builds from the same sources. Both arms were built by the script’s own nginx-build.sh build-arm, one with 1.22.46’s tool (recipe 7, with HTTP/3) and one with 1.22.47’s (recipe 8, without). Same nginx 1.31.10, same libraries, LTO on, no BOLT, so the comparison is the recipe and not a BOLT profile.
  • Each with its own configuration. Each arm served its own release’s /etc/nginx tree, so the HTTP/3 includes were present for 1.22.46 and gone for 1.22.47, as on a real server. The 1.22.47 tree also carries that release’s guest-cache fixes, which add one more variable to the XenForo cache gate, so the A/B covers both request-path changes.
  • A third arm for reference: the installed 1.22.47 build with BOLT, which is what a server actually runs.
  • Same load for every arm. XenForo 2.3.14 with synthetic seeded data (20k users, 10k threads, 100k posts), PHP 8.5.13, clock pinned at 3.6 GHz, 5 rounds with the arm order rotated each round, 100 connections for 10 s per tier. The arms were switched with a runtime unit drop-in and an nginx restart.

Median requests per second, with the min-max of the five rounds:

Tier1.22.46 (HTTP/3)1.22.47 (no HTTP/3)1.22.47 installed, BOLT
Guest home, cached140,910 (140,788-143,990)141,460 (+0.4 %) (139,681-142,810)145,953 (+3.6 %) (142,685-149,277)
Guest thread, cached101,896 (99,129-104,757)101,442 (-0.4 %) (99,404-104,545)104,570 (+2.6 %) (103,908-106,040)
Guest home, uncached380 (380-382)382 (+0.5 %) (381-382)383 (+0.8 %) (381-385)
Guest thread, uncached291 (290-293)294 (+1.0 %) (292-294)292 (+0.3 %) (292-295)
Member home314 (313-317)315 (+0.3 %) (313-318)316 (+0.6 %) (314-318)
Member thread214 (214-215)214 (+0.0 %) (213-216)214 (+0.0 %) (214-216)

Every tier lands between -0.4 % and +1.0 %, and on every tier the two ranges overlap. Removing HTTP/3 neither helped nor hurt, which is what you’d expect from a module that never runs on the TCP path. I didn’t compare p99 latency here: the summary kept it from a single round, which is too noisy to read either way.

The BOLT column is a side result. On the two cached tiers, where nginx does almost all the work, the installed BOLT build is 2.6-3.6 % faster than either LTO-only build. On the PHP tiers nginx is a small share of the time, so it makes no difference there. That matches earlier BOLT results: it pays where the binary itself is the bottleneck.

Why the numbers were lower than the morning’s#

The PHP tiers in this A/B sat well below the baseline I recorded the same morning on the same host and build: member home 314 instead of 349, uncached guest home 380 instead of 393. Nothing in nginx changed between the two. If I had compared the new arm against the morning’s number, I’d have reported a 10 % regression that doesn’t exist.

The cause was the test data. XenForo logs every thread view in xf_content_activity_log, and by the afternoon a day of benchmark runs had added 166k views. The home page’s trending query sums that table on every member request. MariaDB’s CPU per member-home request rose about 60 %, and the PHP tiers slowed with it.

It didn’t affect the result, because every arm ran on the same data, interleaved round by round. It’s still a lesson worth writing down: a benchmark changes the data it measures. Compare arms run side by side in one session, with the order rotated, the way the PGO post ran its builds, and treat a baseline from another day, or even earlier the same day, as a rough reference only.

What I didn’t measure#

  • Only the Xeon. I didn’t run this A/B on the AMD EPYC 7401P (Zen 1) server. Since the module isn’t on the TCP request path, I don’t expect a different answer there, but I haven’t checked.
  • No memory or binary-size comparison. The build without HTTP/3 should be slightly smaller. I didn’t record by how much.
  • Nothing through Cloudflare. The A/B hit the origin directly. What visitors see from Cloudflare’s edge, including HTTP/3, didn’t change, and I didn’t try to measure it.
  • No WordPress or Chevereto tiers. This round was XenForo only.

Updating is the usual --optimize. It rebuilds nginx once, cleans the vhosts first, and leaves the firewall alone. Run --basic afterwards if you also want UDP 443 closed.

Back to top ↑