HttpArena

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.

MedalAwardFieldRank
🥇 GoldWithin its languageKotlin · HTTP/1.11 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.

FamilyRankComposite
HTTP/1.131 of 882316
HTTP/228 of 34369
HTTP/311 of 17228
WebSocket27 of 31370
Database8 of 8352

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.

SuiteToolPassedFailed
HTTP/1.1http11probe d50d818125 of 159 (78.6%)34
HTTP/2h2spec 2.6.0129 of 146 (88.4%)17
HTTP/3h3spec v0.1.1558 of 81 (71.6%)23

HTTP/1.1: what failed

TestExpectedGot
RFC9112-5.1-OBS-FOLD Obs-fold (line folding) in headers should be rejected (RFC 9112 §5.1, MUST)400200, connection left open
RFC9112-7.1-MISSING-HOST Request without Host header must be rejected with 400 (RFC 9112 §3.2, MUST)400200, connection left open
RFC9112-2.3-INVALID-VERSION Invalid HTTP version must be rejected (RFC 9112 §2.3, SHOULD)400/505, close, or timeout = warn200, connection left open
COMP-HOST-WITH-USERINFO Host header with userinfo (user@host) must be rejected (RFC 9112 §3.2, MUST)400 or close200, connection left open
COMP-HOST-WITH-PATH Host header with path component must be rejected (RFC 9112 §3.2, MUST)400 or close200, 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 = warn404, 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 = warn404, 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 close200, connection left open
COMP-METHOD-CONNECT CONNECT to an origin server must be rejected (RFC 9110 §9.3.6, SHOULD)400/405/501 or close404, connection left open
COMP-HOST-EMPTY-VALUE Empty Host header value must be rejected (RFC 9112 §3.2, MUST)400 or close200, 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 = warn404, connection left open
COMP-DATE-HEADER Origin server must include Date header in responses (RFC 9110 §6.6.1, MUST)2xx with Date header200, 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 = warn404, connection left open
SMUG-TE-XCHUNKED Transfer-Encoding: xchunked must not be treated as chunked (RFC 9112 §6.1, MUST)400/501 or close200, 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 close200, 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 close200, connection left open
SMUG-CHUNK-UNDERSCORE Chunk size with underscores (1_0) must be rejected (RFC 9112 §7.1, MUST)400 or close200, connection left open
SMUG-TE-EMPTY-VALUE Transfer-Encoding with empty value must be rejected (RFC 9112 §6.1, MUST)400 or close200, 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 close200, connection left open
SMUG-CHUNK-SIZE-PLUS Chunk size with leading plus sign must be rejected (RFC 9112 §7.1, MUST)400 or close200, 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 close200, connection left open
SMUG-CHUNK-LEADING-SP Chunk size with leading space must be rejected (RFC 9112 §7.1, MUST)400 or close200, connection left open
SMUG-CHUNK-MISSING-TRAILING-CRLF Chunk data without trailing CRLF must be rejected (RFC 9112 §7.1, MUST)400 or close200, 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 close200, connection left open
SMUG-CHUNK-EXT-CTRL NUL byte in chunk extension must be rejected (RFC 9112 §7.1.1, MUST)400 or close200, 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 close200, connection left open
SMUG-TE-IDENTITY Transfer-Encoding: identity (deprecated) with CL must be rejected (RFC 9112 §7, MUST)400/501 or close200, connection left open (Used CL (ignored TE variant))
SMUG-CHUNK-NEGATIVE Negative chunk size must be rejected (RFC 9112 §7.1, MUST)400 or close200, connection left open
SMUG-MULTIPLE-HOST-COMMA Host header with comma-separated values must be rejected (RFC 9110 §7.2, MUST)400 or close200, 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 close200, 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 close404, connection left open
MAL-NON-ASCII-URL Non-ASCII bytes (UTF-8 é) in URL must be rejected (MUST)400 or close404, connection left open
MAL-CHUNK-SIZE-OVERFLOW Chunk size with integer overflow must be rejected (MUST)400 or close200, connection left open
MAL-URL-OVERLONG-UTF8 Overlong UTF-8 encoding of / (0xC0 0xAF) in URL must be rejected (MUST)400 or close404, connection left open

HTTP/2: what failed

TestExpectedGot
generic/4/4 Sends a POST request with trailersHEADERS Frame (stream_id:1)Timeout
http2/3.5/2 Sends invalid connection prefaceGOAWAY Frame (Error Code: PROTOCOL_ERROR) or Connection closedError: unexpected EOF
http2/5.1/5 half closed (remote): Sends a DATA frameGOAWAY Frame (Error Code: STREAM_CLOSED) or RST_STREAM Frame (Error Code: STREAM_CLOSED) or Connection closedTimeout
http2/5.1/6 half closed (remote): Sends a HEADERS frameGOAWAY Frame (Error Code: STREAM_CLOSED) or RST_STREAM Frame (Error Code: STREAM_CLOSED) or Connection closedTimeout
http2/5.1/12 closed: Sends a HEADERS frameGOAWAY Frame (Error Code: STREAM_CLOSED) or Connection closedRST_STREAM Frame (length:4, flags:0x00, stream_id:1)
http2/5.1.1/2 Sends stream identifier that is numerically smaller than previousGOAWAY Frame (Error Code: PROTOCOL_ERROR) or Connection closedDATA 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)" stateGOAWAY Frame (Error Code: STREAM_CLOSED) or RST_STREAM Frame (Error Code: STREAM_CLOSED) or Connection closedTimeout
http2/6.3/2 Sends a PRIORITY frame with a length other than 5 octetsGOAWAY Frame (Error Code: FRAME_SIZE_ERROR) or RST_STREAM Frame (Error Code: FRAME_SIZE_ERROR) or Connection closedTimeout
http2/6.9/2 Sends a WINDOW_UPDATE frame with a flow control window increment of 0 on a streamGOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closedTimeout
http2/6.9.1/3 Sends multiple WINDOW_UPDATE frames increasing the flow control window to above 2^31-1 on a streamRST_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 flagGOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closedTimeout
http2/8.1.2.1/3 Sends a HEADERS frame that contains a pseudo-header field as trailersGOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closedTimeout
http2/8.1.2.3/2 Sends a HEADERS frame that omits ":method" pseudo-header fieldGOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closedDATA Frame (length:7, flags:0x01, stream_id:1)
http2/8.1.2.3/3 Sends a HEADERS frame that omits ":scheme" pseudo-header fieldGOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closedDATA Frame (length:7, flags:0x01, stream_id:1)
http2/8.1.2.3/4 Sends a HEADERS frame that omits ":path" pseudo-header fieldGOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closedHEADERS 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 lengthGOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closedTimeout
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 lengthGOAWAY Frame (Error Code: PROTOCOL_ERROR) or RST_STREAM Frame (Error Code: PROTOCOL_ERROR) or Connection closedTimeout

HTTP/3: what failed

TestExpectedGot
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.

CategoryProfileConnsReq/secAvgp99CPUMemory
ConnectionBaseline4,0961,005,7364.08ms8.27ms5758.6%11.8GiB
ConnectionPipelined4,0962,148,46630.45ms40.30ms5360.2%69.7GiB
ConnectionShort-lived4,096747,1495.45ms52.90ms5670.9%10.3GiB
ConcurrencyAsync Delay32,000865,61336.95ms56.00ms5484.8%24.0GiB
EfficiencyLatency-10K1,0249,981121.9us153.0us64.8%606MiB
EfficiencyLatency-1M1,024997,471414.8us3351.0us5511.2%12.2GiB
WorkloadJSON Comp4,096216,03518.95ms74.60ms6228.7%18.8GiB
WorkloadJSON Comp16,384145,288112.42ms850.60ms5894.8%88.2GiB
WorkloadJSON TLS4,096489,1508.60ms79.23ms4705.9%10.6GiB
Workload8Gbit51249,344149.7us219.0us461.6%2.5GiB
WorkloadStatic TLS1,024246,8394.76ms78.32ms6167.0%4.8GiB
DatabaseAsync DB1,02461,01116.78ms20.70ms2442.4%5.0GiB
DatabaseFortunes1,02440,13325.55ms48.80ms3254.3%23.9GiB
HTTP/2Baseline256806,20531.12ms50.57ms6214.5%92.9GiB
HTTP/2Baseline1,024734,383130.70ms344.41ms6017.6%121.0GiB
HTTP/2Static256218,13436.93ms63.49ms5947.4%15.8GiB
HTTP/2Static1,02462,333444.79ms1.25s6046.5%13.2GiB
HTTP/2Baseline (h2c)256796,40031.68ms61.78ms6359.4%90.2GiB
HTTP/2Baseline (h2c)1,024755,753135.48ms325.34ms6017.0%121.3GiB
HTTP/2Baseline (h2c)4,096402,242914.65ms1.49s5231.3%126.2GiB
HTTP/2JSON (h2c)1,024394,57380.10ms273.18ms4890.9%64.7GiB
HTTP/2JSON (h2c)4,096339,795367.71ms819.40ms5164.4%123.7GiB
HTTP/3Baseline64339,77512.44ms47.18ms4420.3%5.7GiB
HTTP/3Static64100,78036.16ms146.90ms6270.0%4.4GiB
WebSocketEcho5121,036,325493us1.13ms3380.3%2.5GiB
WebSocketEcho4,096951,1224.31ms9.64ms3422.0%5.2GiB
WebSocketEcho16,384730,52222.44ms45.70ms3484.4%8.7GiB
WebSocketEcho Pipelined51211,000,318743us2.35ms3329.2%3.8GiB
WebSocketEcho Pipelined4,09610,198,8356.43ms15.70ms3553.4%5.6GiB
WebSocketEcho Pipelined16,3849,062,40628.92ms64.90ms3288.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.

EntryCompositevs ktor
ktor-tuned2873+24%head to head
neton1483-36%head to head
http4k1188-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