Skip to content

v1.2.2

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Nov 19:36

zoxy 1.2.2: HTTP/3 slots come back when they should. zoxy now
refuses a QUIC client it has no room for outright, instead of leaving it
to time out. And the pool stops filling with connections that are already
over, so far fewer clients need refusing: on the benchmark's c1k-h3
profile, none.

Replace the binary; no config changes.

Fixes

  • A client the QUIC pool has no room for is refused, not left to time
    out
    (#454). zoxy answers its first Initial with CONNECTION_CLOSE and
    CONNECTION_REFUSED (RFC 9000 §5.2.2), so the client gives up or falls
    back to TCP at once. Before, the Initial went unanswered and the client
    waited out its own handshake timeout. The refusal is a few dozen octets
    against the client's 1,200, so it amplifies nothing. Each one is counted
    in the new zoxy_h3_refused.

  • A closing connection gives its slot back at once (#476). A
    connection in its closing or draining period (RFC 9000 §10.2, three
    PTOs) kept its whole slot until the period ended: the ~835 KiB of
    transport and stream buffers, and the TLS engine. Now the slot is free
    as soon as the connection's CONNECTION_CLOSE is out. A record of about
    300 B holds the rest of the period, which §10.2 asks a server not to
    cut short:

    • a late packet for the connection is not taken for a new connection
      or met with a stateless reset;
    • a closing connection's record answers it with the same close, at a
      falling rate and never more than three times what triggered it;
    • a draining connection's record answers nothing.

    The new zoxy_h3_closes_repeated counts those answers.

  • A retired connection whose client has gone closes within a fraction
    of a second, not a minute
    (#475). Since 1.2.1, a connection that sent
    a GOAWAY waits for the client to acknowledge everything before closing.
    A client that leaves sends its last acknowledgement and its close once.
    When that datagram was lost, zoxy kept the connection, and its slot,
    for a full idle window. Now it stops waiting once three probe timeouts
    in a row go unanswered: seven PTOs of silence.

Why these three ship together

#454 alone made things worse on the benchmark, which is why it waited
for the other two (zoxy-io/benchmark#21). c1k-h3 gives zoxy 1,024 QUIC
slots for 1,000 clients, and the pool overflowed twice in every run:

  • at the start, where zrk gives up on handshakes that take it more than
    two seconds and opens new ones while the old ones are still closing;
  • at keepalive_requests, where all 1,000 connections are retired and
    replaced within seconds.

Before #454 most of the clients turned away got in on a retransmitted
Initial a moment later. With #454 alone, each one became a failed request: 2,068
on the run that measured it, against 506 on 1.2.1. #475 and #476 free
the slots those connections held, and with all three nothing is refused.

Under the hood

  • h3 moves from 004f04a to ba373f8 (zoxy-io/h3#13):
    endpoint.writeRefusal, the stateless Initial carrying the refusal.
    The audit is recorded beside the pin in build.zig.zon.
  • zoxy --check prices a QUIC connection about 300 B more (its
    closing record), and the metrics render buffers 304 B larger (the two
    new counters).
  • The test client can vanish. TestClient.vanishes goes silent
    once answered, the way a client whose last datagram was lost looks to
    the server.

Checked against

  • The gates. Every change passed the unit and fuzz corpus, the lint,
    4,096 simulator seeds with the census, and the live gate in both the
    default and the shipped ReleaseSafe build.

  • The tests. Each new test fails with its fix removed:

    • a client the pool has no room for hears CONNECTION_REFUSED;
    • a client right behind a closing connection, with one QUIC slot, is
      served;
    • a late packet is answered with the close from its record, not a
      stateless reset;
    • a close the anti-amplification limit holds back keeps its slot
      until it goes out;
    • a retired connection whose client vanished frees its slot within
      2 s, where it held it for the idle window.
  • zoxy-io/benchmark's c1k-h3: 1,000 HTTP/3 connections, 10 KiB
    answers, a ramp past saturation on one core, zrk 3.0.5, against nginx
    in the same run.

    run zoxy refused failed requests (zoxy / nginx) sustained req/s (zoxy / nginx)
    45168255501 1.2.1 — 506 / 441 5,298 / 5,678
    45218693431 #454 alone 2,046 2,068 / 343 4,760 / 5,642
    45234088370 this release 0 1 / 14 5,785 / 6,340

    zoxy completed 1,655,378 requests to nginx's 1,765,861.

  • The soak. A run on this release's code passed: 8 × 500,000
    seeds, 584,000,001 to 588,000,000, census ok on every shard,
    run 45234680204.

Upgrading

Replace the binary; no config changes. A QUIC connection costs about
300 B more, priced in the banner. A client turned away for want of a
QUIC slot now hears CONNECTION_REFUSED rather than nothing, and a load
generator counts that as a failed connection rather than a slow one.