users@glassfish.java.net

Re: Poor concurrent Jersey Client performance

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 19 May 2010 13:13:04 +0200

On May 18, 2010, at 2:17 PM, glassfish_at_javadesktop.org wrote:

> I'm using jmeter to call a WADL service. Performance is poor. I
> attribute this to not specifying httpclient properties: max-total-
> connections and max-connections-per-host. I'd like to be able to set
> this otherwise the defaults will be too low (2).
>

So you basically want to change the properties of:

  MultiThreadedHttpConnectionManager
  http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.html

  ?

You can obtain the HttpClient from:

   ApacheHttpClient.getClientHandler().getHttpClient()

then from that you can obtain the HttpConnectionManager and cast it.
However, i do not know if sich properties can be set after
initialization.

The alternative is to create your own instance of HttpClient as follows:

         MultiThreadedHttpConnectionManager m = new
MultiThreadedHttpConnectionManager();
         // Set properties
         HttpClient hc = new HttpClient(m);
         ApacheHttpClient c = new ApacheHttpClient(new
ApacheHttpClientHandler(hc));

Paul.

> I pulled down the source it appears that these properties can't be
> set.
> My search wasn't exhaustive. BTW- I tried to set these properties in
> clientconfig.
> [Message sent by forum member 'davesiracusa']
>
> http://forums.java.net/jive/thread.jspa?messageID=470273
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>