New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: HTTP/2 client sending RST_STREAM at more than 2500 transactions-per-second (TPS) #52845
Comments
Also, note that although my build environment is Windows, I am compiling into a Linux executable.
|
cc @neild |
@bradfitz do you have any inputs on this ? |
This comment was marked as off-topic.
This comment was marked as off-topic.
A client timeout set with The |
thanks @neild I am using the low-level HTTP/2 transport directly due to the fact that I need to do non-TLS HTTP/2 traffic as below. if protocol == "http1" {
httpTransport = &http.Transport{
MaxConnsPerHost: config.MaxConnectionsPerHost(),
MaxIdleConns: config.MaxIdleConnections(),
MaxIdleConnsPerHost: config.MaxIdleConnectionsPerHost(),
//IdleConnTimeout: 10 * time.Second,
}
} else if protocol == "http2" {
httpTransport = &http2.Transport{
AllowHTTP: true,
DialTLS: func(network, addr string, cfg *tls.Config) (net.Conn, error) {
return net.Dial(network, addr)
},
StrictMaxConcurrentStreams: config.StrictMaxConcurrentStreams(),
}
} |
@neild I tried with multiple connections to the server and basically round-robin'ed / distributed all my requests over those multiple connections and this now seems to work upto a point where the requests per second per endpoint/connection hits around 2500. Or are there some internal channels used by the net/http package which are getting full and hence causing the other requests to get blocked ? What is the maximum number of requests that the net/http transport can hold on it's inbound side before more calls get blocked ? |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am using a non-TLS HTTP/2 go client program which sends more than 2500 POST requests per second to a Netty based HTTP/2 server. (Note : I am running this program on a Linux 64-bit machine. So basically my build envt is Windows, but the run envt is Linux).
Each of the request is sent by a separate goroutine which in turn calls the following
ChfConnection.SendUpdate()
method spawned in another goroutine.When the rate of requests is as low as about 2000 per second, then I do not see my client sending RST_STREAM to the server.
However, when the rate is about 2500-3000 per second, I see the following in my program log file (after enabling
GODEBUG="http2debug=2"
):I am confused as to which context deadline is being exceeded ?
The client timeout that I have set in my HTTP client is 5 seconds whereas based on the log messages above, the time between the last part of the DATA frame and the time when I see the context deadline is just about 100 ms !!!
What did you expect to see?
No such errors
What did you see instead?
As mentioned above, I see Roundtrip timeout errors. This leads to message/request rate to be much lower (about 30% lower) than what I expect it to be.
The text was updated successfully, but these errors were encountered: