hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HTTPCLIENT-894) To decrease the number of connections for connection manager dynamically.
Date Tue, 24 Nov 2009 10:04:39 GMT

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-894?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved HTTPCLIENT-894.
------------------------------------------

       Resolution: Invalid
    Fix Version/s:     (was: 3.1.1)

> 1) Is there any way or alternative to decrease the connections dynamically without shutting
down connection manager? 

The connection manager will gradually decrease the number of connections in the pool as they
expire. It will not drop open connections proactively. The only way to alter this behavior
is building a custom connection manager .

>  2) What will happen to those threads using my client if i shutdown my manager in bertween
request processing? 

The connection manager will be rendered unusable. However, one can close all active connections
in the pool by calling #closeIdleConnections(0)

Please in the future DO NOT USE JIRA to ask questions. That is what mailing lists are for.

Oleg

> To decrease the number of connections for connection manager dynamically.
> -------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-894
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-894
>             Project: HttpComponents HttpClient
>          Issue Type: Question
>          Components: HttpClient
>    Affects Versions: 3.1 Final
>         Environment: Windows
>            Reporter: Alok Chaudhary
>            Priority: Minor
>
> Hello,
> I have a quick query regarding MultiThreadedHttpConnectionManager. At the application
startup, i fetched no of connections value from my cache. Based on the connection value, i
initialized MultiThreadedHttpConnectionManager.
> MultiThreadedHttpConnectionManager  mgr = new MultiThreadedHttpConnectionManager() ;
> mgr.getParams().setDefaultMaxConnectionsPerHost(10); 
> mgr.getParams().setMaxTotalConnections(10); 
> HttpClient client = new HttpClient(mgr) ;
> Now if i dynamically increase the no of connections say "12" in my cache then my netstas
shows me 12 connections. I dont have any issue in this.
> But when i dynamically decrease the number of connections say "8", connection manager
does not reflect the "8" connections. Netstat still shows "12" connections in established
state.
> I have 20 threads those are using my HttpClient, so i dont want to shut down my connection
manager.
> My questions are:
>  1) Is there any way or alternative to decrease the connections dynamically without shutting
down connection manager?
>   2) What will happen to those threads using my client if i shutdown my manager in bertween
request processing?
> Any help will be appreciated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message