title: ActiveMQ 5.10/ QPid 0.28/ AMQP 1.0 performance issue
body: <p>I am trying to do a performance benchmark of using Openwire and AMQP with ActiveMQ and getting huge variation in throughput</p>
  
  <p><strong>Using Openwire</strong></p>
  
  <p>Persistent Message size: 43 byes, 
      no compression,
      200 concurrent connections,
      throughput around 9006 msgs/sec.</p>
  
  <p>Persistent Message size: 1580 byes, 
      no compression,
      200 concurrent connections, 
      throughput around 3678.86 msgs/sec.</p>
  
  <p>There is <strong>not much load on CPU</strong> less than 5% so I can use compression to get better throughput but that's a different story.</p>
  
  <p><strong>Using AMQP 1.0</strong></p>
  
  <p>Persistent Message size: 43 byes, 
      no compression,
      200 concurrent connections, 
      throughput around 12.8 msgs/sec.</p>
  
  <p>Persistent Message size: 1580 byes, 
      no compression, 
      200 concurrent connections, 
      throughput around 11.9 msgs/sec.</p>
  
  <p>Our configuration is as</p>
  
  <pre><code>**Client**
      - JMeter 2.11 using Apache QPid 0.28 as AMQP 1.0 client
      - Java 1.7
      - Ubuntu 12.04 LTS Quad Core 2.0 GHz,7GB RAM, 512 KB Cache
  
  **Broker**
      - ActiveMQ 5.10 with KahaDB, using LevelDB didn't give much different numbers
      - Java 1.7
      - Ubuntu 12.04 LTS Quad Core 2.0 GHz,7GB RAM, 512 KB Cache
  </code></pre>
  
  <p><strong>Tuning Efforts:</strong></p>
  
  <p>I looked at the following</p>
  
  <p>For Openwire, on Broker side, changed tcp to nio</p>
  
  <pre><code>&lt;transportConnector name="openwire" uri="nio://0.0.0.0:61616?maximumConnections=1000&amp;amp;wireFormat.tcpNoDelayEnabled=true&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
  
  On Client side url was as
      tcp://&lt;broker ip&gt;:61616?jms.useAsyncSend=true
  </code></pre>
  
  <p>For AMQP 1.0, on Broker side, changed to nio and added some options on url but have no apparent effect</p>
  
  <pre><code>&lt;transportConnector name="amqp" uri="amqp+nio://0.0.0.0:5672?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
  
  On Client side
      connectionFactory = amqp://username:password@&lt;broker ip&gt;:5672?remote-host=default
  </code></pre>
  
  <p>All the tuning options available on Openwire are not available on amqp, especially on producer using jms.useAsyncSend=true gave me huge performance boost, of course with the less reliability of ack. I came to know that by default sending message with amqp is in async mode by default. Apparently the numbers are telling us that it is possibly being processed in synchronous mode ?</p>
  
  <p>Here are some of the links that I already look into</p>
  
  <ul>
  <li><a href="http://activemq.apache.org/amqp.html" rel="nofollow">http://activemq.apache.org/amqp.html</a></li>
  <li><a href="http://bhavin.directi.com/rabbitmq-vs-apache-activemq-vs-apache-qpid/" rel="nofollow">http://bhavin.directi.com/rabbitmq-vs-apache-activemq-vs-apache-qpid/</a></li>
  <li><a href="http://activemq.2283324.n4.nabble.com/Interesting-Persistent-Messaging-Performance-td4676001.html" rel="nofollow">http://activemq.2283324.n4.nabble.com/Interesting-Persistent-Messaging-Performance-td4676001.html</a></li>
  <li><a href="http://activemq.2283324.n4.nabble.com/Any-Performance-Latency-benchmarks-for-ActiveMQ-s-AMQP-implementation-against-OpenWire-td4674713.html" rel="nofollow">http://activemq.2283324.n4.nabble.com/Any-Performance-Latency-benchmarks-for-ActiveMQ-s-AMQP-implementation-against-OpenWire-td4674713.html</a></li>
  <li><a href="http://www.slideshare.net/ceposta/activemq-performance-tuning#" rel="nofollow">http://www.slideshare.net/ceposta/activemq-performance-tuning#</a></li>
  <li><p><a href="http://working-with-activemq.blogspot.com/2012/05/performance-improvements.html" rel="nofollow">http://working-with-activemq.blogspot.com/2012/05/performance-improvements.html</a></p>
  
  <p>Are there configuration (for connections or channels) or tuning options with ActiveMQ AMQP and/or QPid that I are unaware of ?</p></li>
  </ul>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>As Tim pointed out below, my comparisons were incorrect, I was using Async.Send for Openwire and Sync.Send for AMQP 1.0, it was my mis-understanding that AMQP 1.0 by default uses Async.Send. Robbie pointed out that is not the case for Persistent messages. Here are the correct comparison numbers</p>
  
  <p><strong>Synchronous Send using Openwire</strong>
  Persistent Message size: 43 byes, 
      no compression,
      200 concurrent connections,
      100,000 message count,
      throughput around 13.1 msgs/sec.</p>
  
  <p>Persistent Message size: 1580 byes, 
      no compression,
      200 concurrent connections, 
      100,000 message count,
      throughput around 13.1 msgs/sec.</p>
  
  <p><strong>Synchronous Send using AMQP 1.0</strong>
  Persistent Message size: 43 byes, 
      no compression,
      200 concurrent connections, 
      100,000 message count,
      throughput around 12.8 msgs/sec.</p>
  
  <p>Persistent Message size: 1580 byes, 
      no compression,
      200 concurrent connections,
      100,000 message count,
      throughput around 11.9 msgs/sec.</p>
  
  <p><strong>Async.Send using Openwire</strong>
  Persistent Message size: 43 byes,
      no compression,
      200 concurrent connections,
      100,000 message count,
      throughput around 9006 msgs/sec.</p>
  
  <p>Persistent Message size: 1580 byes, 
      no compression,
      200 concurrent connections,
      100,000 message count,
      throughput around 3678.86 msgs/sec.</p>
  
  <p><strong>Async.Send using  AMQP 1.0</strong>
  Persistent Message size: 43 byes, 
      no compression,
      200 concurrent connections,
      100,000 message count,
      throughput around 21.7 msgs/sec.</p>
  
  <p>Persistent Message size: 1580 byes, 
      no compression,
      200 concurrent connections,
      100,000 message count,
      throughput around 21.2 msgs/sec.</p>
  
  <p><strong>Note:</strong></p>
  
  <p>Even though with Async.Send message delivery is not guaranteed, using Openwire I always received all 100,0000 messages while with AMQP 1.0 around 25% of messages went missing.</p>
  
  <p>AMQP 1.0 Async.Send numbers are still not close to Openwire Async.Send numbers. Any other suggestion(s) ?</p>
  
  <p>Thanks for your help.</p>