1

I have a Netty 4.1-based server. I have taken great care to make it be a well-behaved HTTP/2 citizen. Part of this effort involves handling both so-called "prior knowledge" and upgrade-from-HTTP-1.1 scenarios.

I have tested my application using curl --http2 (which will do an upgrade if necessary) and curl --http2-prior-knowledge. It responds fine in both cases and does what I would expect.

Recently, I discovered vegeta, a great little load test tool. It has an -h2c option, which I believe does what curl --http2-prior-knowledge does (HTTP/2 without TLS and without doing an "upgrade me from HTTP 1.1 please" dance.

Nevertheless, when I hit my server with vegeta attack with the -h2c option, even using just one request (via -rate=1/2s -duration=2s), vegeta hangs, unable to read the body:

Error Set:
net/http: request canceled (Client.Timeout exceeded while reading body)

To my knowledge, vegeta is written in Go and therefore probably uses the Go h2c library. curl uses nghttp. If I handle curl's HTTP/2-via-prior-knowledge request properly but vegeta has trouble with it, what does this mean?

Laird Nelson
  • 15,321
  • 19
  • 73
  • 127

0 Answers0