[jboss-user] [Remoting] - Re: JBREM-877: New Socket Connection is being Created for Ev

ron.sigal@jboss.com do-not-reply at jboss.com
Sat Feb 23 02:08:08 EST 2008


I've added a new feature to the Remoting 2.4 branch which allows the destruction of a client invoker to be delayed by some number of microseconds.  The idea is to pick a delay long enough that the client invoker will still be around to be used by the next invocation on the same server.  It could be useful in a situation where there are not a lot of concurrent invocations.

The delay is turned off by default, but it can be turned on by setting the parameter Client.INVOKER_DESTRUCTION_DELAY (actual value "invokerDestructionDelay") to a positive integer.  The value can be set either by

* adding "invokerDestructionDelay=xxx" to the InvokerLocator, or
* adding the value with key "invokerDestructionDelay" to the configuration map passed to the Client constructor.

For EJB3 clients, the value should be set in the Connector MBean in the file .../server/default/deploy/ejb3.deployer/META-INF/jboss-service.xml.

Just to illustrate the value of this feature, I ran the following loop:


  |       for (int i = 0; i < 10000; i++)
  |       {
  |          Client client = new Client(locator, config);
  |          client.connect();
  |          client.invoke("abc");
  |          client.disconnect();
  |       }
  | 

with and without a delay, and I got the following results:


  |    run     delay=0   delay=5000
  |    -------------------------------
  |      1      46937       22657
  |      2      49265       24016
  |      3      47750       23375
  | ---------------------------------
  |     avg:    47989       23349
  | 
  | 

The average speed up is a factor of 2.06.  This was a simple in-jvm test, with nothing else going on, but it's still interesting.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131602#4131602

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131602



More information about the jboss-user mailing list