Skip to content

Comment on Using HTTP/2 Cleartext for a server in Go 1.24parent

Comments

It has a bit, but there are fundamental issues. Given the way the Go runtime wants to deal with reading and writing sockets, HTTP/2 requires 2 extra goroutines per connection, and the bouncing around over channels that this implies. This might not be a law of physics but there isn't another obvious way to do it in Go.

In the past when I wanted a really fast Go service using HTTP/2 I put the HTTP server in a C++ subprocess that handled the sockets and communicated with the Go application over a pipe. That was nice and fast, avoided the congestive collapse that Go suffers with too many runnable goroutines.

Any idea at what point that happens, or how much too many is?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.