You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Ahmed Badran <aa...@yahoo.com> on 2005/06/11 02:42:23 UTC

MaxRequestsPerConnection

Hi
I just joined the mailing list recently. but was wondering if you can have
number of requests per connection configurable.  some hardware load
balancers do the balancing based on connections and not on requests.  so
instead of hamering one box with multiple requests (since the httpclient
is reusing the same connection over and over, for 20 min sometimes), it
would be great to be able to limimt the number of requests per connection.
 

I see that Apache http server (httpd.conf) has KeepAlive,
MaxKeepAliveRequests, etc) to handle the server side.  do you think this
can help in limiting the client from reusing the same connection? 
However, I am using Jetty http server, so does it have similare configs?

Thanks,

--- Ahmed Badran



		
__________________________________ 
Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 
http://discover.yahoo.com/online.html

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: MaxRequestsPerConnection

Posted by Michael Becke <mb...@gmail.com>.
Hi Ahmed,

None of the built-in connection managers have the ability to control
how many times a connection is used.  It would be fairly simple to
write your own implementation of HttpConnectionManager to perform this
task.  <http://jakarta.apache.org/commons/httpclient/3.0/apidocs/org/apache/commons/httpclient/HttpConnectionManager.html>

You could also enforce that a connection is never reused by overriding
releaseConnection() in one of the existing connection managers and
always call connection.close().

Mike

On 6/10/05, Ahmed Badran <aa...@yahoo.com> wrote:
> Hi
> I just joined the mailing list recently. but was wondering if you can have
> number of requests per connection configurable.  some hardware load
> balancers do the balancing based on connections and not on requests.  so
> instead of hamering one box with multiple requests (since the httpclient
> is reusing the same connection over and over, for 20 min sometimes), it
> would be great to be able to limimt the number of requests per connection.
> 
> 
> I see that Apache http server (httpd.conf) has KeepAlive,
> MaxKeepAliveRequests, etc) to handle the server side.  do you think this
> can help in limiting the client from reusing the same connection?
> However, I am using Jetty http server, so does it have similare configs?
> 
> Thanks,
> 
> --- Ahmed Badran
> 
> 
> 
> 
> __________________________________
> Discover Yahoo!
> Have fun online with music videos, cool games, IM and more. Check it out!
> http://discover.yahoo.com/online.html
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: MaxRequestsPerConnection

Posted by Roland Weber <RO...@de.ibm.com>.
Hello Ahmed,

> I see that Apache http server (httpd.conf) has KeepAlive,
> MaxKeepAliveRequests, etc) to handle the server side.  do you think this
> can help in limiting the client from reusing the same connection? 

Yes. A connection is not re-used if either the client or the server
decides it should be closed. This is also a better place for this kind
of configuration than the client, since the server can be tuned to
interact well with the load balancer. The client might be hitting a
wide range of different servers where other settings might be more
appropriate.

> However, I am using Jetty http server, so does it have similare configs?

You'll have to check the Jetty documentation or ask the Jetty guys.

cheers,
  Roland