You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2014/05/11 00:11:34 UTC

[jira] [Resolved] (AMQ-5144) stomp+nio+ssl very slow message sending

     [ https://issues.apache.org/jira/browse/AMQ-5144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish resolved AMQ-5144.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 5.10.0
         Assignee: Timothy Bish

Found the trouble spot and fixed it, should fix issues across all protocols with their NIO+SSL performance. 

> stomp+nio+ssl very slow message sending
> ---------------------------------------
>
>                 Key: AMQ-5144
>                 URL: https://issues.apache.org/jira/browse/AMQ-5144
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: stomp
>    Affects Versions: 5.9.0
>         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
>            Reporter: B
>            Assignee: Timothy Bish
>             Fix For: 5.10.0
>
>
> Hi there 
> I have following broker config: 
>  <transportConnector name="stomp" uri="stomp+nio+ssl://0.0.0.0:61612?maximumConnections=10000&amp;wireFormat.maxFrameSize=104857600"/>
> ACTIVEMQ_OPTS_MEMORY="-Xms1G -Xmx2G -Dorg.apache.activemq.UseDedicatedTaskRunner=false"
> And followind code snippet:
> {code}
>  @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);
>   }
> {code}
> Results for stomp+ssl : 
> {code}
> Sending message - size 1000 kb
> Reply received
>  Execution time = 0 seconds[221 ms]
> {code}
> Results for stomp+nio :  (i modified test client to not use ssl socket)
> {code}
> Sending message - size 1000 kb
> Reply received
>  Execution time = 0 seconds[399 ms]
> {code}
> Results for stomp+nio+ssl : 
> {code}
> Sending message - size 1000 kb
> Reply received
> Execution time = 54 seconds[54162 ms]
> {code}
> So from above we see that for stomp+nio+ssl it takes very long time to send a message. 
> Anyone knows whats wrong ?



--
This message was sent by Atlassian JIRA
(v6.2#6252)