[rabbitmq-discuss] Consumer Performance Issues?

cOre dUmPeR marv_lush at yahoo.com
Tue Sep 27 00:47:32 BST 2011


Hello all. I've been attempting to benchmark RabbitMQ to see what kind of max messages rates I might expect in a production deployment.
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.
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.
Some basics about my test setup:
HW------(3) EC2 m1.xlarge boxes - 4 cores, 15GB mem     1 producer, 1 consumer, 1 broker
Broker----------Basic RabbitMQ broker install. Didnt really play with any options, except installing the Management plugins and using a different port than default.
Producer-------------Java Client. 4 Producer threads, each with its own connection and channel. Direct exchange, NO persist, NO autodelete. Connect and Send methods look like:
	public void openConnection() throws IOException {		ConnectionFactory cfconn = new ConnectionFactory();		cfconn.setHost(host);		cfconn.setPort(port);		LOGGER.debug("opening connection to: " + host + ":" + port);		connection = cfconn.newConnection();		channel = connection.createChannel();
		LOGGER.debug("queue info: routing_key: " + routingKey + ", exchange: " + exchange);		channel.queueDeclare(ROUTING_KEY, false, false, false, null);	}
	public void send(byte[] message) throws IOException {		channel.basicPublish(exchange, routingKey, null, message);	}
Consumer---------------Java client, 4 consumer threads, each with its own connection and channel. AutoAck YES. Connect and Receive methods look like:

	public void openConnection() throws IOException {		ConnectionFactory cfconn = new ConnectionFactory();		cfconn.setHost(host);		cfconn.setPort(port);		LOGGER.debug("opening connection to: " + host + ":" + port);		connection = cfconn.newConnection();		channel = connection.createChannel();
		LOGGER.debug("queue info: queue_name: " + queueName);		channel.queueDeclare(QUEUE_NAME, false, false, false, null);
		consumer = new QueueingConsumer(channel);		channel.basicConsume(QUEUE_NAME, true, consumer);	}
	public String receive() throws IOException, ShutdownSignalException, ConsumerCancelledException,			InterruptedException {		Delivery delivery = consumer.nextDelivery(10);		String retval = null;
		if (delivery != null) {			retval = new String(delivery.getBody());		}
		return retval;	}
Messages-----------------JSON bytes, about 150bytes each message.
Other Details--------------------The only thing the consumer is doing after a message is received, is converting bytes-->JSONString-->Object...then moving on. My consumer CPU load is almost nothing, SO I dont think its the Consumer holding things up.  On the broker side....there is only 1 CPU out of 4 that is doing any real work. Is this normal? 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.
Any ideas? Or things I should change?
Thanks,/Marv
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110926/0ac0944c/attachment.htm>


More information about the rabbitmq-discuss mailing list