I wrote a small program that runs a repeated GET against a given URL.
However, the DisableKeepAlives boolean does not seem to be honored. Code is
similar to this:
transport := &http.Transport{
DisableKeepAlives: false,
}
client := &http.Client{
Transport: transport,
}
for i := 0; i < 10; i++ {
_, err := client.Get("https://foo.com")
}
Based on the code, I would expect the HTTP session to stay alive. I ran the
preceding code with keepalive enabled and disabled, performance was not
impacted. I then did a TCPDump and saw that the TCP session was being built
and torn down with every HTTP Request. I have a feeling that I'm missing
something. Does anyone have any ideas?
Go 1.11.1 on CentOS 7
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/59629684-46ba-4ca5-94d6-93de5c51c216%40googlegroups.com.