1

We recently switched from HTTP/1 to HTTP/2 for our server communication and using OKHTTP library on the client to talk to the server.

this.client = new OkHttpClient.Builder()
            .protocols(Protocol.H2_PRIOR_KNOWLEDGE)


       .connectionSpecs(Collections.singletonList(ConnectionSpec.CLEARTEXT))
        .build();

Previously we were using connection pools with Http1. Now with multiplexing feature with HTTP2 I am not sure if its a good idea to use a connection pool and how it would work anyways.

Any advise on some pros and cons of using a connection pool with Http2 and any general guidelines on how to tune it?

dogfish
  • 2,646
  • 4
  • 21
  • 37

1 Answers1

0

Yes: Do we still need a connection pool for microservices talking HTTP2?

In the answer above you will find references to HTTP/2 clients (since they are used to invoke other microservices) and how to tune the HTTP/2 flow control window.

sbordet
  • 16,856
  • 1
  • 50
  • 45
  • So this is a duplicate? – Rob Apr 27 '20 at 23:39
  • It's a slight different scenario (client-only vs microservices - which are typically server-side), but almost everything said in that answer applies to the client as well. It's not a duplicate question IMHO, just a duplicate _answer_ :) – sbordet Apr 27 '20 at 23:41