15

I'm trying to understand what is the difference between them. I tried to read the documentation but it does not help alot.

HttpClientBuilder
                    .create()
                    .setMaxConnPerRoute(maxConnectionsPerRoute)
                    .setMaxConnTotal(maxConnectionTotal)
                    .build();

It's the same of setDefaultMaxPerRoute and setMaxTotal from PoolingHttpClientConnectionManager:

final PoolingHttpClientConnectionManager poolingmgr = new PoolingHttpClientConnectionManager();
poolingmgr.setDefaultMaxPerRoute(max);
poolingmgr.setMaxTotal(2 * max);

1 Answers1

19

setMaxConnTotal is the total maximum connections available in the connection pool. setMaxConnPerRoute is the total number of connections limit to a single port or url.

Hope it is clear now

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Sukh
  • 424
  • 5
  • 16
  • can anyone suggest what should be production values for this considering 1000 TPS traffic? – Saurabh Galande Sep 14 '20 at 06:12
  • 3
    @Saurabhgalande it should be at least 1000 TPS / (1 / TIME) = TIME * 1000 TPS number of pool size. Here TIME means how many seconds each request takes time in Seconds. I.e if On average, server responds in 0.5 second and your TPS=1000, then pool size of 500 should be lower limit. – RustamIS Dec 22 '20 at 03:20