org.apache.httpcomponents.client5 connection pooling are giving me varying response times

74 Views Asked by At

I have an application running where the application is multithreaded to call an API with different requests in different threads. The volume of all the requests are same in each thread. Between the multithreaded calls, there are huge differences between the response times.

There are 19 calls and we have 19 threads calling the API. To improve the overall performance of the application, I have increased the connection pool size 50 and max pool size to 100 but we are seeing the same set of results. In those 19 calls, 17 calls are processed in 200-300 ms but the next 2 calls are processed in 1700 ms leading to the total time elapsed by the application to correspondingly increase.

Settings: Thread: PoolSize: 60 MaxPoolSize: 100 HTTP Connection Pooling: Poolsize: 50 MaxPoolSize: 100

Can someone provide me insight on where the problem is and how to solve this. Additionally, can someone provide the optimised way of working with connection pooling and multithreading.

Thanks

0

There are 0 best solutions below