my dog learned polymorphism*
The moose likes Other Open Source Projects and the fly likes Apache HTTP Conn Pooling Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Apache HTTP Conn Pooling Problem" Watch "Apache HTTP Conn Pooling Problem" New topic
Author

Apache HTTP Conn Pooling Problem

Srikanth Vz
Greenhorn

Joined: Aug 06, 2010
Posts: 4
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

Joined: Sep 29, 2008
Posts: 12617

Are you actually running out of connections?
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

And welcome to Javaranch!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Srikanth Vz
Greenhorn

Joined: Aug 06, 2010
Posts: 4
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

Joined: Aug 06, 2010
Posts: 4
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

PatienceIsAVirtue , have you tried different values?
Srikanth Vz
Greenhorn

Joined: Aug 06, 2010
Posts: 4
Martijn Verburg wrote:PatienceIsAVirtue , have you tried different values?


I tried with different values also.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache HTTP Conn Pooling Problem
 
Similar Threads
getConnection() from datasource is occasionally taking a very long time
How to open a connection pool to a database?
SLSB VS MDB
WebSphere configuration for heavy load.
running out of ManagedConnections available