In my golang application we were using the http Client with custom TLS config, and as per the golang’s x/net/http package if we provide a custom TLS Config then the support for http/2 will be disabled. So for enabling the http/2 support with custom TLS config I enabled the flag
ForceAttemptHTTP2 flag, but with that I’m seeing a 200MB of memory spike in my application.
I’m running this application on a 800 Hosts setup. But as of now none of the Hosts has a http/2 support enabled still I’m seeing this memory spike.
Did the profiling of my application using the pprof, adding profiling details in thread.
Any ideas on why this high memory usage is happening?
Since I enabled the http/2 support, after the protocol negotiation since I didn’t had any hosts supporting http/2 the request should fallback to http/1.1 and application should behave normally.
Though requests were falling back to http/1.1 but there was 250MB more memory usage by the application.