Skip to content

Update Ktor to 3.6.0 - #1481

Merged
MDA2AV merged 2 commits into
MDA2AV:mainfrom
ktorio:ktor-3.6
Sep 18, 2026
Merged

MDA2AV merged 2 commits into
MDA2AV:mainfrom
ktorio:ktor-3.6

Conversation

@bjhham

@bjhham bjhham commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Description

This updates Ktor to the latest version, including HTTP/3 and a number of performance improvements that I introduced after hammering away at the Netty engine a couple weeks ago.


PR Commands — comment on this PR to trigger (requires collaborator approval):

Command Description
/benchmark -f <framework> Run every test the framework subscribes to
/benchmark -f <framework> -t <test> Run one test only
/benchmark -f <framework> --save Run and save results (updates the leaderboard on merge)
/benchmark -f <framework> -t <test> --save Run one test and save results
/benchmark -f <framework> --compare <other> Measure the deltas against another framework instead of this one
/benchmark-multiple -f <fw1>,<fw2>,... Benchmark several frameworks in one run — takes -t and --save too; saved results land in a single commit
/benchmark-multiple --save No -f needed: benchmark and save every framework the PR touches
/benchmark-test -t <test> Benchmark all enabled frameworks subscribed to <test> and save the results

For /benchmark, always specify -f <framework>; the flags combine in any order. Results come back as a comment with a per-profile table of RPS, p99, CPU and memory — one table per framework on multi runs. A new benchmark comment while a run is in flight queues behind it (one deep) instead of cancelling it. For multi-framework PRs (dependency bumps, same-language refactors) prefer /benchmark-multiple, which runs everything in a single job and commits all saved results together, so no run overwrites another. --compare works on single-framework runs only.

What the deltas are measured against. By default, this framework's own results published on main - answering "did this change help?". When you are tuning a variant or a successor entry, --compare re-bases them on another entry instead:

/benchmark -f genhttp --compare genhttp-kestrel

The reply states which baseline it used, and profiles the other framework does not run show n/a rather than a delta.


Run benchmarks locally

You can validate and benchmark your framework locally with the lite script — no CPU pinning, fixed connection counts, all load generators run in Docker.

./scripts/validate.sh <framework>
./scripts/benchmark-lite.sh <framework> baseline
./scripts/benchmark-lite.sh --load-threads 4 <framework>

Requirements: Docker Engine on Linux. Load generators (gcannon, h2load, h2load-h3, wrk) are built as self-contained Docker images on first run.

@bjhham

bjhham commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

/benchmark-multiple -f ktor,ktor-tuned

@github-actions

Copy link
Copy Markdown
Contributor

👋 Benchmark request received. A collaborator will review and approve the run.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Frameworks: 2 | Test: all tests

ktor

Test Conn RPS Rate CPU/req p99 p99.9 CPU Mem Δ RPS Δ Mem
baseline 4096 956,018 5777.2% 5.2GiB +16.3% -45.3%
pipelined 4096 2,112,308 5401.4% 9.2GiB +261.2% -48.6%
limited-conn 4096 709,415 5537.8% 5.7GiB +6.6% +29.5%
json-comp 4096 203,187 6062.1% 5.5GiB +5.3% +5.8%
json-comp 16384 203,258 6239.1% 9.9GiB +7.3% -11.6%
json-tls 4096 482,107 4763.1% 8.1GiB +23.0% -12.9%
8gbit 512 49,336 0.9867 116.78us 245.0us 12700.0us 543.1% 1.5GiB +0.3% -44.4%
static-tls 1024 199,936 6325.0% 4.4GiB -2.3% +15.8%
async-db 1024 48,494 2504.1% 2.9GiB -53.3% -69.8%
fortunes 1024 62,105 5033.5% 10.7GiB +21.7% +42.7%
baseline-h2 256 804,286 6299.7% 14.4GiB +44.0% -51.7%
baseline-h2 1024 697,599 6351.7% 24.7GiB +28.7% -17.7%
static-h2 256 211,874 5969.1% 9.0GiB +11.7% -43.8%
static-h2 1024 134,286 5720.3% 9.5GiB -25.5% -61.5%
baseline-h2c 256 838,087 6438.5% 12.7GiB +103.3% -58.6%
baseline-h2c 1024 759,599 6357.6% 24.8GiB +88.5% -20.3%
baseline-h2c 4096 452,286 5680.4% 31.2GiB +61.5% ~0%
json-h2c 1024 447,200 5438.9% 12.6GiB +42.3% -55.3%
json-h2c 4096 419,016 5342.3% 27.4GiB +48.2% -8.4%
baseline-h3 64 338,472 4629.4% 3.2GiB NEW NEW
static-h3 64 102,955 5888.6% 2.4GiB NEW NEW
echo-ws 512 1,024,145 3411.5% 2.8GiB +0.3% +12.0%
echo-ws 4096 950,673 3379.0% 2.0GiB -3.0% -69.7%
echo-ws 16384 783,696 3287.8% 6.1GiB +21.4% -58.8%
echo-ws-pipeline 512 11,172,181 3360.2% 3.0GiB -0.4% -72.2%
echo-ws-pipeline 4096 10,628,080 3400.9% 3.0GiB -0.2% -76.9%
echo-ws-pipeline 16384 8,054,771 3475.1% 6.3GiB -9.3% -69.6%
latency-1m 1024 997,582 0.9976 53.22us 16872.0us 128288.0us 5396.6% 4.9GiB +13.5% -2.0%
latency-10k 1024 9,981 0.9981 75.12us 152.0us 2219.0us 72.1% 1.5GiB ~0% +230.3%
latency-500k-8cpu 1024 210,364 0.4207 ⚠️ 32.85us 11423744.0us 11702272.0us 682.1% 1.3GiB +6.6% ~0%
async 32000 226,870 2338.1% 6.7GiB -7.1% -59.9%

ktor-tuned

Test Conn RPS Rate CPU/req p99 p99.9 CPU Mem Δ RPS Δ Mem
baseline 4096 1,281,059 6518.6% 9.8GiB ~0% ~0%
pipelined 4096 2,437,398 6070.3% 9.8GiB ~0% ~0%
limited-conn 4096 547,139 4674.8% 9.8GiB ~0% ~0%
json-comp 4096 240,495 6245.3% 6.6GiB ~0% ~0%
json-comp 16384 236,191 6092.6% 9.4GiB ~0% ~0%
json-tls 4096 842,743 6324.2% 6.8GiB ~0% ~0%
8gbit 512 49,329 0.9866 87.54us 191.0us 10140.0us 471.6% 1.7GiB ~0% ~0%
static-tls 1024 258,353 6310.6% 4.6GiB ~0% ~0%
async-db 1024 52,833 2227.2% 2.8GiB ~0% ~0%
baseline-h2 256 1,118,369 6337.5% 10.6GiB ~0% ~0%
baseline-h2 1024 1,048,754 6360.2% 26.0GiB ~0% ~0%
static-h2 256 227,851 6196.7% 8.6GiB ~0% ~0%
static-h2 1024 213,239 5841.5% 12.0GiB ~0% ~0%
baseline-h2c 256 1,162,718 6344.3% 13.7GiB ~0% ~0%
baseline-h2c 1024 1,086,015 6427.4% 25.9GiB ~0% ~0%
baseline-h2c 4096 535,627 5128.5% 29.9GiB ~0% ~0%
json-h2c 1024 705,685 6238.9% 12.0GiB ~0% ~0%
json-h2c 4096 665,557 6143.6% 26.3GiB ~0% ~0%
baseline-h3 64 362,107 2926.8% 4.8GiB ~0% ~0%
static-h3 64 91,646 3500.8% 2.1GiB ~0% ~0%
echo-ws 512 994,108 6292.8% 1.7GiB ~0% ~0%
echo-ws 4096 1,135,731 6359.0% 4.3GiB ~0% ~0%
echo-ws 16384 990,277 6263.9% 6.3GiB ~0% ~0%
echo-ws-pipeline 512 11,381,851 6194.0% 8.7GiB ~0% ~0%
echo-ws-pipeline 4096 12,543,004 6282.9% 11.0GiB ~0% ~0%
echo-ws-pipeline 16384 12,471,290 6270.1% 10.9GiB ~0% ~0%
latency-1m 1024 997,578 0.9976 54.94us 3145.0us 12724.0us 5893.5% 5.2GiB ~0% ~0%
latency-10k 1024 9,981 0.9981 45.64us 131.0us 2107.0us 43.3% 1.6GiB ~0% ~0%
latency-500k-8cpu 1024 265,880 0.5318 ⚠️ 30.00us 9383936.0us 9728000.0us 790.9% 2.4GiB ~0% ~0%
async 32000 316,403 2381.6% 7.5GiB ~0% ~0%

- Add HTTP/3 benchmarks
- Move ktor-ghost to ktor-tuned
- Implement delay endpoint
- Tuning adjustments for tuned version
@bjhham
bjhham marked this pull request as ready for review September 18, 2026 13:40
@MDA2AV
MDA2AV merged commit aadc522 into MDA2AV:main Sep 18, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants