[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17422233#comment-17422233
 ] 

Oleg Kalnichevski edited comment on HTTPCLIENT-2180 at 9/29/21, 4:41 PM:
-------------------------------------------------------------------------

> so the methods would still need a connection initiator, how we will plan to 
>solve this problem

[~anuragagarwal56] We could provide a means of obtaining an 
{{ConnectionInitiator}} from the client or have the client provide a method to 
call the connection pool's method and pass its {{ConnectionInitiator}} as an 
agument.

> What according to you should be the signature of this new method?

The async version should take {{FutureCallback}} as an argument and return a 
{{Future}}. Otherwise it is entirely up to you. Just bear in mind you are 
designing this feature for other users as well, not just your particular 
application.

Oleg 


was (Author: olegk):
> so the methods would still need a connection initiator, how we will plan to 
>solve this problem

[~anuragagarwal56] We could provide a means of obtaining an 
{{ConnectionInitiator}} from the client or have the client provide a method to 
call use the connection pool's method and pass its {{ConnectionInitiator}} as 
an agument.

> What according to you should be the signature of this new method?

The async version should take {{FutureCallback}} as an argument and return a 
{{Future}}. Otherwise it is entirely up to you. Just bear in mind you are 
designing this feature for other users as well, not just your particular 
application.

Oleg 

> Pre-init minimum number of connections
> --------------------------------------
>
>                 Key: HTTPCLIENT-2180
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2180
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpClient (async), HttpClient (classic)
>            Reporter: Anurag Agarwal
>            Priority: Minor
>              Labels: volunteers-wanted
>             Fix For: Future
>
>
> Most of the applications suffer from a problem of cold start where we don't 
> have connections created at the start of the application and thus the first 
> few requests suffer by making a lot of connections.
> During deployment this can even pile up a lot of not completed request and 
> may lead to losses.
> One suggestion I had in mind is to create few connections before the 
> application has begun from the intended endpoints.
> Also sometimes the nautre of your traffic can be spiky in which scenario 
> opening and closing a lot of connections also doesn't make sense.
>  
> These can be solved with either or both of the suggestions:
>  # Have a minConnectionPerHost policy in connection pool which won't let 
> connection pool for a host to go below this number or make a new connection 
> when it does. At the start of the http client these minimum connections will 
> be created to the end services.
>  # Provide an easy mechanism for use to create connections via 
> ConnectionManager. Currently in PoolingAsyncConnectionManager one must give 
> ConnectionInitiator which make it difficult to directly use the connection 
> manager to create connections.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to