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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/AMQ-5144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13983457#comment-13983457 ]

Timothy Bish commented on AMQ-5144:
-----------------------------------

Have you tried using a profiler to see where the time is being spent on the stomp+nio+ssl case vs the others, perhaps that will shed some light on things.  

> 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
>
> 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)
Reply | Threaded
Open this post in threaded view
|

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

javaduke
This post was updated on .
I'm having exact same issue with nio+ssl protocol (not using stomp). Here's my configuration snippet:

<transportConnector name="nio+ssl" uri="nio+ssl://0.0.0.0:9843?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>       

My setup is very simple, producer, consumer and activemq are all running on the same machine. If messages are relatively small (<100K), I don't see any noticeable delay. However, as message size increases, the delay between enqueuing a message and delivering it to the consumer grows exponentially. My average message size is about 1M and I see ~ 2 minutes delay between enqueuing and delivering to the consumer. There are no exceptions or warnings in the log, no CPU spikes, no GC cycles, nothing like that, everything looks normal.

If I change protocol from nio+ssl to any other (plain tcp, plain ssl or plain nio), messages are delivered instantly.

This behavior is reproducible with ActiveMQ 5.9.0 and 5.9.1 on OS X and Red Hat, JDK 1.7.0_45 64-bit.