x/net/http2 reverse proxy http2 connection pool

I am use go reverse proxy

clinet (100 User) ← http2 → go proxy ← http2 → Server

code

	proxy := httputil.NewSingleHostReverseProxy(site)

	tr := &http.Transport{
		MaxIdleConns:        100000,
		MaxIdleConnsPerHost: 100000,
		IdleConnTimeout:     time.Minute * time.Duration(1),
		TLSClientConfig: &tls.Config{
			InsecureSkipVerify: true,
		},
	}
	err = http2.ConfigureTransport(tr)
	if err != nil {
		panic(err)
	}

	proxy.Transport = tr
	handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		proxy.ServeHTTP(w, r)
	})

	err = http.ListenAndServeTLS(":12345", cert, key, handler)
	if err != nil {
		panic(err)
	}

For http2 reverse proxy, make only a single connection with the server.
The go proxy ↔ server has 1 connection, so if a tcp retransmission occurs, everyone is locked.
As a result of checking the wrk, We found that both response time and bandwidth were decreasing.

No matter how multiplexing http2 becomes, tcp single connection appears to be a problem.
If I use reverse proxy http2, do I have to make the connection pool myself?
Is there a way to increase the connection between proxy and server?

The test response size is 9Mbyte.

http 1.1
./wrk -c100 -d30s -t1 https://127.0.0.1:12345
Running 30s test @ https://127.0.0.1:12345
1 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 697.24ms 24.07ms 827.46ms 72.43%
Req/Sec 271.15 261.07 820.00 56.94%
4218 requests in 30.06s, 37.73GB read
Requests/sec: 140.33
Transfer/sec: 1.26GB

http 2.0
./wrk -c100 -d30s -t1 https://127.0.0.1:12345
Running 30s test @ https://127.0.0.1:12345
1 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.35s 372.40ms 2.00s 68.50%
Req/Sec 66.23 58.17 525.00 92.96%
1823 requests in 30.01s, 16.45GB read
Socket errors: connect 0, read 4, write 0, timeout 547
Requests/sec: 60.74
Transfer/sec: 561.32MB

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.