I have a telecom client application which connects to an HTTP/2 server (5G telecom application server, to be exact).
At startup, I create an HTTP/2 client using the net/http2 Transport.
It starts multiple goroutines each of which share/use the same HTTP/2 client connection to send HTTP POST requests to the server.
I was of the understanding that if an HTTP/2 client is reused across multiple goroutines, it will not end up creating multiple TCP connections.
What I observed was that this is not true with (nearly) each goroutine request triggering the creation of a TCP connection. This causes my application to run out of file descriptors. I could possibly get around this by setting the ulimit to be unlimited.
I then set the UseStrictMaximumConcurrentStreams flag in the http2/Transport object to True and this then restricted the client application to establish a single TCP connection.
But the issue I face is that at when I try to send extremely high number of concurrent requests (more than about 3000-4000 per second), I see an empty JSON request body being sent out.
So I guess I have 2 issues :
1) Why is my HTTP/2 client creating multiple TCP connections when the http2.Transport.StrictMaxConcurrentStreams is FALSE ? I am guessing this is because of a large number concurrent requests being made, but still I expect the http2 transport to manage that transparently.
2) When I do manage to create just a single TCP connection (by setting StrictMaxConcurrentStreams=TRUE) over which requests/responses are multiplexed, I see a NULL payload being sent in my HTTP/2 request.
Regards,
Neeraj