Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-5144

stomp+nio+ssl very slow message sending

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.9.0
    • Fix Version/s: 5.10.0
    • Component/s: STOMP
    • Labels:
      None
    • Environment:

      Linux 3.11.0-15-generic #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linuxjava version "1.7.0_45"
      Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
      Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode

      Description

      Hi there

      I have following broker config:

      <transportConnector name="stomp" uri="stomp+nio+ssl://0.0.0.0:61612?maximumConnections=10000&wireFormat.maxFrameSize=104857600"/>

      ACTIVEMQ_OPTS_MEMORY="-Xms1G -Xmx2G -Dorg.apache.activemq.UseDedicatedTaskRunner=false"

      And followind code snippet:

       @Test
        public void plainStompTest() throws Exception {
      
      
          StompConnection sender = new StompConnection();
          StompConnection receiver = new StompConnection();
      
          System.setProperty("javax.net.ssl.keyStore", "/home/user/.keystore/client.ks");
          System.setProperty("javax.net.ssl.trustStore", "/home/user/.keystore/client.ts");
          System.setProperty("javax.net.ssl.keyStorePassword", "changeme");
          System.setProperty("javax.net.ssl.trustStorePassword", "changeme");
      
          SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
          SSLSocket sslsocket1 = (SSLSocket) factory.createSocket("localhost", 61612);
          SSLSocket sslsocket2 = (SSLSocket) factory.createSocket("localhost", 61612);
      
          sender.open(sslsocket1);
          receiver.open(sslsocket2);
      
          sender.connect("admin", "admin");
          receiver.connect("admin", "admin");
      
          receiver.subscribe("/queue/receiver");
          Thread.sleep(1000); // wait until subscribed
      
          char[] data = new char[toSendBytesMsgSize];
          Arrays.fill(data, 'a');
      
          long startTime = System.currentTimeMillis();
          logger.info("Sending message - size " + toSendBytesMsgSize / 1024 + " kb");
      
          sender.send("/queue/receiver", new String(data));
          StompFrame frame = receiver.receive(0);
      
          byte[] body = frame.getBody().getBytes();
      
          long stopTime = System.currentTimeMillis();
          long elapsedTime = stopTime - startTime;
      
          logger.info("Reply received");
      
          logger.info("Execution time = " + elapsedTime / 1000 + " seconds" + "[" + elapsedTime + " ms]");
      
          assertEquals(toSendBytesMsgSize, body.length);
      
      
        }
      

      Results for stomp+ssl :

      Sending message - size 1000 kb
      Reply received
       Execution time = 0 seconds[221 ms]
      

      Results for stomp+nio : (i modified test client to not use ssl socket)

      Sending message - size 1000 kb
      Reply received
       Execution time = 0 seconds[399 ms]
      

      Results for stomp+nio+ssl :

      Sending message - size 1000 kb
      Reply received
      Execution time = 54 seconds[54162 ms]
      

      So from above we see that for stomp+nio+ssl it takes very long time to send a message.

      Anyone knows whats wrong ?

        Attachments

          Activity

            People

            • Assignee:
              tabish Timothy A. Bish
              Reporter:
              kibibyte B
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: