<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><font class="Apple-style-span" face="arial" size="2">Hello all. I've been attempting to benchmark RabbitMQ to see what kind of max messages rates I might expect in a production deployment.</font><div style="font-family: arial; font-size: 10pt; "><br></div><div style="font-family: arial; font-size: 10pt; ">One thing I've been seeing that has me a little puzzled is that (for my test setup) message rates on the input side are an order of magnitude higher that on the output side. Meaning I can push 25K msgs/sec from my producer. However, my consumer, only seems to get about 2.5K msgs/sec...although both consumer and producer are setup similarly.</div><div style="font-family: arial; font-size: 10pt; "><br></div><div style="font-family: arial; font-size: 10pt; ">Do I have something misconfigured? Or is this expected? I would expect *some* difference between
 producer(s)/consumer(s)...but not an order of magnitude.</div><div style="font-family: arial; font-size: 10pt; "><br></div><div style="font-family: arial; font-size: 10pt; ">Some basics about my test setup:</div><div style="font-family: arial; font-size: 10pt; "><br></div><div style="font-family: arial; font-size: 10pt; ">HW</div><div style="font-family: arial; font-size: 10pt; ">------</div><div style="font-family: arial; font-size: 10pt; ">(3) EC2 m1.xlarge boxes - 4 cores, 15GB mem</div><div style="font-family: arial; font-size: 10pt; ">&nbsp; &nbsp; &nbsp;1 producer, 1 consumer, 1 broker</div><div style="font-family: arial; font-size: 10pt; "><br></div><div style="font-family: arial; font-size: 10pt; ">Broker</div><div style="font-family: arial; font-size: 10pt; ">----------</div><div style="font-family: arial; font-size: 10pt; ">Basic RabbitMQ broker install. Didnt really play with any options, except installing the Management plugins and using a
 different port than default.</div><div style="font-family: arial; font-size: 10pt; "><br></div><div style="font-family: arial; font-size: 10pt; ">Producer</div><div style="font-family: arial; font-size: 10pt; ">-------------</div><div style="font-family: arial; font-size: 10pt; ">Java Client. 4 Producer threads, each with its own connection and channel. Direct exchange, NO persist, NO autodelete. Connect and Send methods look like:</div><div style="font-family: arial; font-size: 10pt; "><br></div><div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space: pre; ">        </span>public void openConnection() throws IOException {</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>ConnectionFactory cfconn = new ConnectionFactory();</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span"
 style="white-space:pre">                </span>cfconn.setHost(host);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>cfconn.setPort(port);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>LOGGER.debug("opening connection to: " + host + ":" + port);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>connection = cfconn.newConnection();</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>channel = connection.createChannel();</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>LOGGER.debug("queue
 info: routing_key: " + routingKey + ", exchange: " + exchange);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>channel.queueDeclare(ROUTING_KEY, false, false, false, null);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space: pre; ">        </span>}</font></div></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2"><div><span class="Apple-tab-span" style="white-space:pre">        </span>public void send(byte[] message) throws IOException {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>channel.basicPublish(exchange, routingKey, null, message);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div></font></div><div style="font-family: arial; font-size: 10pt; "><br></div><div
 style="font-family: arial; font-size: 10pt; ">Consumer</div><div style="font-family: arial; font-size: 10pt; ">---------------</div><div style="font-family: arial; font-size: 10pt; ">Java client, 4 consumer threads, each with its own connection and channel. AutoAck YES. Connect and Receive methods look like:</div><div style="font-family: arial; font-size: 10pt; "><br></div><div style="font-family: arial; font-size: 10pt; "><br></div><div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space: pre; ">        </span>public void openConnection() throws IOException {</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>ConnectionFactory cfconn = new ConnectionFactory();</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">        
        </span>cfconn.setHost(host);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>cfconn.setPort(port);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>LOGGER.debug("opening connection to: " + host + ":" + port);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>connection = cfconn.newConnection();</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>channel = connection.createChannel();</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>LOGGER.debug("queue info: queue_name: " +
 queueName);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>channel.queueDeclare(QUEUE_NAME, false, false, false, null);</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>consumer = new QueueingConsumer(channel);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>channel.basicConsume(QUEUE_NAME, true, consumer);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space: pre; ">        </span>}</font></div></div><div style="font-family: arial; font-size: 10pt; "><br></div><div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space: pre;
 ">        </span>public String receive() throws IOException, ShutdownSignalException, ConsumerCancelledException,</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>InterruptedException {</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>Delivery delivery = consumer.nextDelivery(10);</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>String retval = null;</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>if (delivery != null) {</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>retval
 = new String(delivery.getBody());</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>}</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>return retval;</font></div><div><font class="Apple-style-span" face="arial" size="2"><span class="Apple-tab-span" style="white-space: pre; ">        </span>}</font></div></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Messages</font></div><div><font class="Apple-style-span" face="arial" size="2">-----------------</font></div><div><font class="Apple-style-span" face="arial" size="2">JSON bytes, about 150bytes each message.</font></div><div><font class="Apple-style-span" face="arial"
 size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Other Details</font></div><div><font class="Apple-style-span" face="arial" size="2">--------------------</font></div><div><font class="Apple-style-span" face="arial" size="2">The only thing the consumer is doing after a message is received, is converting bytes--&gt;JSONString--&gt;Object...then moving on. My consumer CPU load is almost nothing, SO I dont think its the Consumer holding things up. &nbsp;<b>On the broker side....there is only 1 CPU out of 4 that is doing any real work. Is this normal?</b> With 4 consumer threads...I would expect more to be happening on the Broker. I know when the Producer is pushing with 4 threads...the broker is generally very busy. But when I stop the producer, and leave the consumer running (again, with 4 threads)...again, I see only 1 CPU on the broker working.</font></div><div><font class="Apple-style-span" face="arial"
 size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Any ideas? Or things I should change?</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Thanks,</font></div><div><font class="Apple-style-span" face="arial" size="2">/Marv</font></div><div style="font-family: arial; font-size: 10pt; "><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"></td></tr></table>