Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache HTTP Conn Pooling Problem

 
Srikanth Vz
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends,

Could anybody please suggest me with your expert advice regarding some important Apache commons HTTP connection pooling problem? Please find the below details that describes my issue with MultithreadedHttpConnectionManager.

I am having 3 different HTTP hosts.
- I have created a HTTP client for each host. (that’s how my app. Should handle)
- I have created the MultithreadedHttpConnectionManager for each http client seperately. Assigned the 'totalMaxConnections' as '25' and 'totalMaxConnectionsPerHost' as '25' to connection manager. Then assigned this connection manager to HTTP client.
- My objective is that whenever I increase the 'totalMaxConnections' and 'totalMaxConnectionsPerHost', 'getConnectionsInPool()' should show me the increased no. of connections opened. Inspite of opening the more no. of (opened connections in pool/in use), It is opening only 9 connections(I guess not exceeding default 20 connections) when I load tested the app with Jmeter (tested with 25 users and 25 loop).

I am assuming that the connection pool manager is opening only 9 connections at max. even I had given 25 max connections. I want to see the MultithreadedHttpConnectionManager should open more than 20 connections when ever I increase the totalMaxConnections which depends upon my app transaction request load is increased.

Could anybody kindly help me by suggesting some solution or advice on this regard. For me, it is highest priority issue that needs to be solved. Please help me.



Thanks and Regards,
SRIKANTH KAKUMANU
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you actually running out of connections?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to Javaranch!
 
Srikanth Vz
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Are you actually running out of connections?


No, I am not running out of connections. Let me explain you the problem in simple way.

1) Initially, I have set the maxTotalConnections as 25 and maxTotalConnectionsPerHost as 25 to MultithreadedHttpConnectionManager.
When i run the JMeter test with 50 threads/users, The connection manager is showing that connectionsInPool as 9 only (It is getting increased but maximum no. is 9). But i am expecting the functionality of connection manager to open all or atleast 20 connections since i have set the maxTotalConnections & maxTotalConnectionsPerHost as 25.

2) Then i have set maxTotalConnections as 40 and maxTotalConnectionsPerHost as 40 to MultithreadedHttpConnectionManager.

I did this to test the connection manager that should open all the maxTotalConnections or at least it should exceed the default 20. But It is showing the 9 only for connectionsInPool method.

I just want to prove that MultithreadedHttpConnectionManager:
A) It should how the no. connections in pool as 25 or 40. (To support maximum opened connections to handle no. of user requests).
Or
B) while running my JMeter tests, it should show me the increasing sign in connectionsInPool i.e. exceeding the default 20.

 
Srikanth Vz
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Srikanth Vz wrote:
David Newton wrote:Are you actually running out of connections?


No, I am not running out of connections. Let me explain you the problem in simple way.

1) Initially, I have set the maxTotalConnections as 25 and maxTotalConnectionsPerHost as 25 to MultithreadedHttpConnectionManager.
When i run the JMeter test with 50 threads/users, The connection manager is showing that connectionsInPool as 9 only (It is getting increased but maximum no. is 9). But i am expecting the functionality of connection manager to open all or atleast 20 connections since i have set the maxTotalConnections & maxTotalConnectionsPerHost as 25.

2) Then i have set maxTotalConnections as 40 and maxTotalConnectionsPerHost as 40 to MultithreadedHttpConnectionManager.

I did this to test the connection manager that should open all the maxTotalConnections or at least it should exceed the default 20. But It is showing the 9 only for connectionsInPool method.

I just want to prove that MultithreadedHttpConnectionManager:
A) It should how the no. connections in pool as 25 or 40. (To support maximum opened connections to handle no. of user requests).
Or
B) while running my JMeter tests, it should show me the increasing sign in connectionsInPool i.e. exceeding the default 20.



Hey, Could anybody please help me on this issue? I am running out of time on this. Please suggest me with your advice?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PatienceIsAVirtue , have you tried different values?
 
Srikanth Vz
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martijn Verburg wrote:PatienceIsAVirtue , have you tried different values?


I tried with different values also.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic