#2054 Performance hit due to socket conn. creation with timeout

Performance
closed-fixed
6
2010-09-15
2010-08-16
Ivar
No

From the versions 2.1.2, we are facing an intermittent performance problems (ranging up to 10 secs for enumerate instance operation). Upon repeated conversations with Dave Blaschke, we have identified that the fix for 2817962 introduced this performance problem.

Discussion

  • Dave Blaschke

    Dave Blaschke - 2010-08-16
    • priority: 5 --> 6
    • assigned_to: nobody --> blaschke-oss
    • status: open --> open-accepted
     
  • Dave Blaschke

    Dave Blaschke - 2010-08-17

    So this is where we are at. The following code, which was in effect prior to 2817962, does NOT show the occasional performance impact:

    this.iSocket = factory.createSocket(this.iUrl.getHost(), this.iUrl.getPort());

    The following code, which was introduced by 2817962 to allow a timeout for the socket connection, DOES show the occasional performance impact:

    this.iSocket = factory.createSocket();
    this.iSocket.connect(new InetSocketAddress(this.iUrl.getHost(), this.iUrl.getPort()), timeout);

    Finally, the following code, which is a slight modification of what was introduced by 2817962, also DOES show the occasional performance impact:

    this.iSocket = factory.createSocket();
    this.iSocket.connect(new InetSocketAddress(this.iUrl.getHost(), this.iUrl.getPort()));

     
  • Dave Blaschke

    Dave Blaschke - 2010-08-23

    Upon further debugging and research, I'm not sure if this is a client issue or a JRE issue. Unless you are using your own custom socket factory via WBEMClientSBLIM.setCustomSocketFactory(), all of these method calls are being handled by the JRE.

    Prior to 2817962 it is:

    this.iSocket = javax.net.DefaultSocketFactory.createSocket(this.iUrl.getHost(),
    this.iUrl.getPort());

    After 2817962 it is:

    this.iSocket = javax.net.DefaultSocketFactory.createSocket();
    this.iSocket.connect(new InetSocketAddress(this.iUrl.getHost(),
    this.iUrl.getPort()), timeout);

    The same behavior is exhibited without the timeout value too. So it looks like the intermittent delay is introduced by:

    1) javax.net.DefaultSocketFactory.createSocket() vs createSocket(String, int)
    2) java.net.Socket.connect(SocketAddress) w/ or w/o timeout
    3) java.net.InetSocketAddress(String, int)

    Thoughts?

     
  • Dave Blaschke

    Dave Blaschke - 2010-09-07

    This appears to be an issue with a change made to Java 5+. Please see Sun bug 5092063 for more info:

    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5092063

    Ravi verified this by putting the IP causing the delay into the system's hosts file and the delay went away.

     
  • Dave Blaschke

    Dave Blaschke - 2010-09-07

    Because a) this is a problem with the JRE, b) there is no apparent code fix to connect to a socket with a timeout and NOT encounter this problem, and c) there are folks dependent both on connecting with a timeout AND not having the performance issue, the best solution for 2.1.6 is to introduce a property to control whether a socket connection is attempted with/without a timeout.

     
  • Dave Blaschke

    Dave Blaschke - 2010-09-08

    Patch sent for community review. During a 1 week period any exploiter may comment on the patch, request changes or turn it down completely (with good reason). For the time being the patch is part of the "Experimental" branch in CVS.

    NOTE: The review period has been shortened to 1 week due to 9/15 release of 2.1.6

     
  • Dave Blaschke

    Dave Blaschke - 2010-09-08
    • status: open-accepted --> open-fixed
     
  • Dave Blaschke

    Dave Blaschke - 2010-09-10

    Patch against HEAD

     
  • Dave Blaschke

    Dave Blaschke - 2010-09-15
    • status: open-fixed --> pending-fixed
     
  • Dave Blaschke

    Dave Blaschke - 2010-09-15

    The community review has completed and we received no substantial critisism. Therefore the patch has been approved and merged into the "HEAD" branch. The next release will pick it up.

     
  • Dave Blaschke

    Dave Blaschke - 2010-09-15

    The patch was picked up by release 2.1.6 and will therefore be closed.

     
  • Dave Blaschke

    Dave Blaschke - 2010-09-15
    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.