ktor
Flagship · Kotlin · engine: netty · standard configuration · completeness 4/4
JetBrains Ktor 3.x on Netty with kotlinx.serialization, JDK 25.
Achievements
🥇 1 Gold. Top three of a field, taken in this entry's own league: the family composite, the same composite among entries written in the same language, and each test profile it is scored on. Every field is the one the badges publish, so a medal and a badge always say the same thing. How medals are awarded.
| Medal | Award | Field | Rank |
|---|---|---|---|
| 🥇 Gold | Within its language | Kotlin · HTTP/1.1 | 1 of 4 |
Composite rank
Each profile of a family is worth its weight × 1,000 to the entry that leads it - 1, or 0.5 apiece for two profiles that measure one thing - and the composite is the sum over the family, less 2.5% for each of routing, middleware, request and response the entry does not do for you - its completeness factor, which the WebSocket and gRPC families do not carry. The field is this entry's own league: engines and reverse proxies are scored apart from frameworks. How it works.
| Family | Rank | Composite |
|---|---|---|
| HTTP/1.1 | 31 of 88 | 2316 |
| HTTP/2 | 28 of 34 | 369 |
| HTTP/3 | 11 of 17 | 228 |
| WebSocket | 27 of 31 | 370 |
| Database | 8 of 8 | 352 |
Protocol compliance
The conformance suites this entry subscribes to, run against it on the benchmark machine: Http11Probe on HTTP/1.1, h2spec on HTTP/2, h3spec on HTTP/3 and Autobahn on WebSocket. A score, not part of the composite. How it works.
| Suite | Tool | Passed | Failed |
|---|---|---|---|
| HTTP/1.1 | http11probe d50d818 | 125 of 159 (78.6%) | 34 |
| HTTP/2 | h2spec 2.6.0 | 129 of 146 (88.4%) | 17 |
| HTTP/3 | h3spec v0.1.15 | 58 of 81 (71.6%) | 23 |
HTTP/1.1: what failed
| Test | Expected | Got |
|---|---|---|
RFC9112-5.1-OBS-FOLD Obs-fold (line folding) in headers should be rejected (RFC 9112 §5.1, MUST) | 400 | 200, connection left open |
RFC9112-7.1-MISSING-HOST Request without Host header must be rejected with 400 (RFC 9112 §3.2, MUST) | 400 | 200, connection left open |
RFC9112-2.3-INVALID-VERSION Invalid HTTP version must be rejected (RFC 9112 §2.3, SHOULD) | 400/505, close, or timeout = warn | 200, connection left open |
COMP-HOST-WITH-USERINFO Host header with userinfo (user@host) must be rejected (RFC 9112 §3.2, MUST) | 400 or close | 200, connection left open |
COMP-HOST-WITH-PATH Host header with path component must be rejected (RFC 9112 §3.2, MUST) | 400 or close | 200, connection left open |
COMP-ASTERISK-WITH-GET Asterisk-form (*) request-target with GET must be rejected (RFC 9112 §3.2.4, MUST) | 400, close, or timeout = warn | 404, connection left open |
COMP-OPTIONS-STAR OPTIONS * is the only valid asterisk-form request (RFC 9112 §3.2.4, MUST) | 2xx or 405; close/timeout = warn | 404, connection left open |
COMP-UNKNOWN-TE-501 Unknown Transfer-Encoding without CL should be rejected with 501 (RFC 9112 §6.1, MUST) | 400/501 or close | 200, connection left open |
COMP-METHOD-CONNECT CONNECT to an origin server must be rejected (RFC 9110 §9.3.6, SHOULD) | 400/405/501 or close | 404, connection left open |
COMP-HOST-EMPTY-VALUE Empty Host header value must be rejected (RFC 9112 §3.2, MUST) | 400 or close | 200, connection left open |
COMP-REQUEST-LINE-TAB Tab as request-line delimiter — SHOULD reject but MAY parse on whitespace (RFC 9112 §3, SHOULD) | 400 or 2xx; close/timeout = warn | 404, connection left open |
COMP-DATE-HEADER Origin server must include Date header in responses (RFC 9110 §6.6.1, MUST) | 2xx with Date header | 200, connection left open |
COMP-VERSION-CASE HTTP version is case-sensitive — lowercase 'http' must be rejected (RFC 9112 §2.3, MUST) | 400, close, or timeout = warn | 404, connection left open |
SMUG-TE-XCHUNKED Transfer-Encoding: xchunked must not be treated as chunked (RFC 9112 §6.1, MUST) | 400/501 or close | 200, connection left open (Used CL (ignored TE variant)) |
SMUG-CHUNK-BARE-SEMICOLON Chunk size with bare semicolon and no extension name must be rejected (RFC 9112 §7.1.1, MUST) | 400 or close | 200, connection left open |
SMUG-CHUNK-EXT-INVALID-TOKEN Chunk extension with invalid token character must be rejected (RFC 9112 §7.1.1, MUST) | 400 or close | 200, connection left open |
SMUG-CHUNK-UNDERSCORE Chunk size with underscores (1_0) must be rejected (RFC 9112 §7.1, MUST) | 400 or close | 200, connection left open |
SMUG-TE-EMPTY-VALUE Transfer-Encoding with empty value must be rejected (RFC 9112 §6.1, MUST) | 400 or close | 200, connection left open (Used CL (ignored TE variant)) |
SMUG-CHUNK-HEX-PREFIX Chunk size with 0x prefix must be rejected (RFC 9112 §7.1, MUST) | 400 or close | 200, connection left open |
SMUG-CHUNK-SIZE-PLUS Chunk size with leading plus sign must be rejected (RFC 9112 §7.1, MUST) | 400 or close | 200, connection left open |
SMUG-CHUNK-SIZE-TRAILING-OWS Chunk size with trailing whitespace before CRLF must be rejected (RFC 9112 §7.1, MUST) | 400 or close | 200, connection left open |
SMUG-CHUNK-LEADING-SP Chunk size with leading space must be rejected (RFC 9112 §7.1, MUST) | 400 or close | 200, connection left open |
SMUG-CHUNK-MISSING-TRAILING-CRLF Chunk data without trailing CRLF must be rejected (RFC 9112 §7.1, MUST) | 400 or close | 200, connection left open |
SMUG-CHUNK-SPILL Chunk declares size 5 but sends 7 bytes — oversized chunk data must be rejected (RFC 9112 §7.1, MUST) | 400 or close | 200, connection left open |
SMUG-CHUNK-EXT-CTRL NUL byte in chunk extension must be rejected (RFC 9112 §7.1.1, MUST) | 400 or close | 200, connection left open |
SMUG-CHUNK-EXT-CR Bare CR (not CRLF) in chunk extension — some parsers treat CR alone as line ending (RFC 9112 §7.1.1, MUST) | 400 or close | 200, connection left open |
SMUG-TE-IDENTITY Transfer-Encoding: identity (deprecated) with CL must be rejected (RFC 9112 §7, MUST) | 400/501 or close | 200, connection left open (Used CL (ignored TE variant)) |
SMUG-CHUNK-NEGATIVE Negative chunk size must be rejected (RFC 9112 §7.1, MUST) | 400 or close | 200, connection left open |
SMUG-MULTIPLE-HOST-COMMA Host header with comma-separated values must be rejected (RFC 9110 §7.2, MUST) | 400 or close | 200, connection left open |
SMUG-CHUNK-INVALID-SIZE-DESYNC Invalid chunk size (+0) with poison byte — detects chunk-size parser desync (RFC 9112 §7.1, MUST) | 400, or close | 200, timed out (Accepted invalid chunk-size request and kept connection open — follow-up GET returned no response) |
MAL-NUL-IN-URL NUL byte in URL should be rejected (MUST) | 400 or close | 404, connection left open |
MAL-NON-ASCII-URL Non-ASCII bytes (UTF-8 é) in URL must be rejected (MUST) | 400 or close | 404, connection left open |
MAL-CHUNK-SIZE-OVERFLOW Chunk size with integer overflow must be rejected (MUST) | 400 or close | 200, connection left open |
MAL-URL-OVERLONG-UTF8 Overlong UTF-8 encoding of / (0xC0 0xAF) in URL must be rejected (MUST) | 400 or close | 404, connection left open |
HTTP/2: what failed
| Test | Expected | Got |
|---|---|---|
generic/4/4 Sends a POST request with trailers | HEADERS Frame (stream_id:1) | Timeout |
http2/3.5/2 Sends invalid connection preface | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or Connection closed | Error: unexpected EOF |
http2/5.1/5 half closed (remote): Sends a DATA frame | GOAWAY Frame (Error Code: STREAM_CLOSED) or RST_STREAM Frame (Error Code: STREAM_CLOSED) or Connection closed | Timeout |
http2/5.1/6 half closed (remote): Sends a HEADERS frame | GOAWAY Frame (Error Code: STREAM_CLOSED) or RST_STREAM Frame (Error Code: STREAM_CLOSED) or Connection closed | Timeout |
http2/5.1/12 closed: Sends a HEADERS frame | GOAWAY Frame (Error Code: STREAM_CLOSED) or Connection closed | RST_STREAM Frame (length:4, flags:0x00, stream_id:1) |
http2/5.1.1/2 Sends stream identifier that is numerically smaller than previous | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or Connection closed | DATA Frame (length:7, flags:0x01, stream_id:5) |
http2/6.1/2 Sends a DATA frame on the stream that is not in "open" or "half-closed (local)" state | GOAWAY Frame (Error Code: STREAM_CLOSED) or RST_STREAM Frame (Error Code: STREAM_CLOSED) or Connection closed | Timeout |
http2/6.3/2 Sends a PRIORITY frame with a length other than 5 octets | GOAWAY Frame (Error Code: FRAME_SIZE_ERROR) or RST_STREAM Frame (Error Code: FRAME_SIZE_ERROR) or Connection closed | Timeout |
http2/6.9/2 Sends a WINDOW_UPDATE frame with a flow control window increment of 0 on a stream | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closed | Timeout |
http2/6.9.1/3 Sends multiple WINDOW_UPDATE frames increasing the flow control window to above 2^31-1 on a stream | RST_STREAM Frame (Error Code: FLOW_CONTROL_ERROR) | RST_STREAM Frame (length:4, flags:0x00, stream_id:1) |
http2/8.1/1 Sends a second HEADERS frame without the END_STREAM flag | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closed | Timeout |
http2/8.1.2.1/3 Sends a HEADERS frame that contains a pseudo-header field as trailers | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closed | Timeout |
http2/8.1.2.3/2 Sends a HEADERS frame that omits ":method" pseudo-header field | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closed | DATA Frame (length:7, flags:0x01, stream_id:1) |
http2/8.1.2.3/3 Sends a HEADERS frame that omits ":scheme" pseudo-header field | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closed | DATA Frame (length:7, flags:0x01, stream_id:1) |
http2/8.1.2.3/4 Sends a HEADERS frame that omits ":path" pseudo-header field | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closed | HEADERS Frame (length:4, flags:0x05, stream_id:1) |
http2/8.1.2.6/1 Sends a HEADERS frame with the "content-length" header field which does not equal the DATA frame payload length | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closed | Timeout |
http2/8.1.2.6/2 Sends a HEADERS frame with the "content-length" header field which does not equal the sum of the multiple DATA frames payload length | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closed | Timeout |
HTTP/3: what failed
| Test | Expected | Got |
|---|---|---|
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if initial_source_connection_id is missing [Transport 7.3] | - | did not get expected exception: QUICException |
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if original_destination_connection_id is received [Transport 18.2] | - | did not get expected exception: QUICException |
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if preferred_address is received [Transport 18.2] | - | did not get expected exception: QUICException |
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if retry_source_connection_id is received [Transport 18.2] | - | did not get expected exception: QUICException |
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if stateless_reset_token is received [Transport 18.2] | - | did not get expected exception: QUICException |
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if a parameter value is malformed [Transport 18] | - | did not get expected exception: QUICException |
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if max_udp_payload_size < 1200 [Transport 7.4 and 18.2] | - | did not get expected exception: QUICException |
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if ack_delay_exponent > 20 [Transport 7.4 and 18.2] | - | did not get expected exception: QUICException |
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if max_ack_delay >= 2^14 [Transport 7.4 and 18.2] | - | did not get expected exception: QUICException |
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if initial_max_streams_bidi > 2^60 [Transport 18.2] | - | did not get expected exception: QUICException |
| QUIC servers MUST send TRANSPORT_PARAMETER_ERROR if initial_max_streams_uni > 2^60 [Transport 18.2] | - | did not get expected exception: QUICException |
| QUIC servers MUST send FRAME_ENCODING_ERROR if a frame is cut short [Transport 12.4] | - | predicate failed on expected exception: QUICException / TransportErrorIsReceived ProtocolViolation "" |
| QUIC servers MUST send PROTOCOL_VIOLATION if reserved bits in Handshake are non-zero [Transport 17.2] | - | did not get expected exception: QUICException |
| QUIC servers MUST send PROTOCOL_VIOLATION if reserved bits in Short are non-zero [Transport 17.3.1] | - | did not get expected exception: QUICException |
| HTTP/3 servers MUST treat a request with keep-alive as malformed [HTTP/3 4.2] | - | did not get expected exception: QUICException |
| HTTP/3 servers MUST treat a request with proxy-connection as malformed [HTTP/3 4.2] | - | did not get expected exception: QUICException |
| HTTP/3 servers MUST treat a request with transfer-encoding as malformed [HTTP/3 4.2] | - | did not get expected exception: QUICException |
| HTTP/3 servers MUST treat a request with upgrade as malformed [HTTP/3 4.2] | - | did not get expected exception: QUICException |
| HTTP/3 servers MUST send H3_FRAME_ERROR if a SETTINGS frame stops mid-parameter [HTTP/3 7.1] | - | did not get expected exception: QUICException |
| HTTP/3 servers treats a repeated setting identifier as an error whatever its value [HTTP/3 7.2.4] | - | did not get expected exception: QUICException |
| HTTP/3 servers MUST send H3_FRAME_UNEXPECTED if PUSH_PROMISE is received [HTTP/3 7.2.5] | - | predicate failed on expected exception: QUICException / ApplicationProtocolErrorIsReceived (ApplicationProtocolError 512) "Decompression of header block failed." |
| HTTP/3 servers MUST send H3_FRAME_ERROR if MAX_PUSH_ID has octets after its push ID [HTTP/3 7.1] | - | predicate failed on expected exception: QUICException / ApplicationProtocolErrorIsReceived (ApplicationProtocolError 261) "Unexpected frame type '0' received" |
| HTTP/3 servers MUST NOT buffer an over-long frame on a control stream [HTTP/3 7.1] | - | predicate failed on expected exception: QUICException / ApplicationProtocolErrorIsReceived (ApplicationProtocolError 262) "Received an invalid frame len 1073741824 for frame of type 7." |
Every result
Alpha Round, 30 runs. Requests per second is the best of three; latency, CPU and memory come from that run.
| Category | Profile | Conns | Req/sec | Avg | p99 | CPU | Memory |
|---|---|---|---|---|---|---|---|
| Connection | Baseline | 4,096 | 1,005,736 | 4.08ms | 8.27ms | 5758.6% | 11.8GiB |
| Connection | Pipelined | 4,096 | 2,148,466 | 30.45ms | 40.30ms | 5360.2% | 69.7GiB |
| Connection | Short-lived | 4,096 | 747,149 | 5.45ms | 52.90ms | 5670.9% | 10.3GiB |
| Concurrency | Async Delay | 32,000 | 865,613 | 36.95ms | 56.00ms | 5484.8% | 24.0GiB |
| Efficiency | Latency-10K | 1,024 | 9,981 | 121.9us | 153.0us | 64.8% | 606MiB |
| Efficiency | Latency-1M | 1,024 | 997,471 | 414.8us | 3351.0us | 5511.2% | 12.2GiB |
| Workload | JSON Comp | 4,096 | 216,035 | 18.95ms | 74.60ms | 6228.7% | 18.8GiB |
| Workload | JSON Comp | 16,384 | 145,288 | 112.42ms | 850.60ms | 5894.8% | 88.2GiB |
| Workload | JSON TLS | 4,096 | 489,150 | 8.60ms | 79.23ms | 4705.9% | 10.6GiB |
| Workload | 8Gbit | 512 | 49,344 | 149.7us | 219.0us | 461.6% | 2.5GiB |
| Workload | Static TLS | 1,024 | 246,839 | 4.76ms | 78.32ms | 6167.0% | 4.8GiB |
| Database | Async DB | 1,024 | 61,011 | 16.78ms | 20.70ms | 2442.4% | 5.0GiB |
| Database | Fortunes | 1,024 | 40,133 | 25.55ms | 48.80ms | 3254.3% | 23.9GiB |
| HTTP/2 | Baseline | 256 | 806,205 | 31.12ms | 50.57ms | 6214.5% | 92.9GiB |
| HTTP/2 | Baseline | 1,024 | 734,383 | 130.70ms | 344.41ms | 6017.6% | 121.0GiB |
| HTTP/2 | Static | 256 | 218,134 | 36.93ms | 63.49ms | 5947.4% | 15.8GiB |
| HTTP/2 | Static | 1,024 | 62,333 | 444.79ms | 1.25s | 6046.5% | 13.2GiB |
| HTTP/2 | Baseline (h2c) | 256 | 796,400 | 31.68ms | 61.78ms | 6359.4% | 90.2GiB |
| HTTP/2 | Baseline (h2c) | 1,024 | 755,753 | 135.48ms | 325.34ms | 6017.0% | 121.3GiB |
| HTTP/2 | Baseline (h2c) | 4,096 | 402,242 | 914.65ms | 1.49s | 5231.3% | 126.2GiB |
| HTTP/2 | JSON (h2c) | 1,024 | 394,573 | 80.10ms | 273.18ms | 4890.9% | 64.7GiB |
| HTTP/2 | JSON (h2c) | 4,096 | 339,795 | 367.71ms | 819.40ms | 5164.4% | 123.7GiB |
| HTTP/3 | Baseline | 64 | 339,775 | 12.44ms | 47.18ms | 4420.3% | 5.7GiB |
| HTTP/3 | Static | 64 | 100,780 | 36.16ms | 146.90ms | 6270.0% | 4.4GiB |
| WebSocket | Echo | 512 | 1,036,325 | 493us | 1.13ms | 3380.3% | 2.5GiB |
| WebSocket | Echo | 4,096 | 951,122 | 4.31ms | 9.64ms | 3422.0% | 5.2GiB |
| WebSocket | Echo | 16,384 | 730,522 | 22.44ms | 45.70ms | 3484.4% | 8.7GiB |
| WebSocket | Echo Pipelined | 512 | 11,000,318 | 743us | 2.35ms | 3329.2% | 3.8GiB |
| WebSocket | Echo Pipelined | 4,096 | 10,198,835 | 6.43ms | 15.70ms | 3553.4% | 5.6GiB |
| WebSocket | Echo Pipelined | 16,384 | 9,062,406 | 28.92ms | 64.90ms | 3288.8% | 68.5GiB |
Compared with
The Kotlin web frameworks around ktor on the HTTP/1.1 composite, and the one leading them. Entries of other leagues are left out: a composite does not carry from one league to another. The last column shows every profile side by side.
| Entry | Composite | vs ktor | |
|---|---|---|---|
| ktor-tuned | 2873 | +24% | head to head |
| neton | 1483 | -36% | head to head |
| http4k | 1188 | -49% | head to head |
Compare ktor with any Kotlin entry · Compare ktor with any entry, in any language · Every Kotlin entry, ranked
Results updated · How the benchmark is run · The machine · Add or fix an entry