[rabbitmq-discuss] Simple benchmark and results
David Glaubman
dglaubman at acm.org
Tue Oct 20 03:46:45 BST 2009
Hi, I am experimenting with RabbitMQ (v1.7.0) on Windows using the .Net
client.
First, my initial reaction to AMQP/RabbitMQ is very positive -- I've
received good support in getting started, the protocol and client API are
clear and seem straightforward, and (so far) everything works.
Second, I’d like to offer some performance numbers for a very simple
benchmark I am using.
Your mileage will most assuredly vary.
And third, I am looking for some insight as to suitability/tunability of
RabbitMQ for a particular use case. (but I'll leave that to my next message)
Thanks,
David
The setup
---------
In local setup, I have one rabbitmq server and one single-threaded client
which runs the benchmark.
In distributed setup, client runs as in local setup, but rabbitmq server
runs on another machine.
Client machine: Quad CPU @ 2.4Ghz, 4Gb memory, running 32-bit Windows XP SP2
Server machine: Quad CPU @ 2.2GHz, 4Gb memory, running 64-bit Windows Server
2008 Standard
Network: 1Gbps Ethernet, tracert shows 2 hops between machines
The benchmark
-------------
Benchmark consists of
1. BasicPublish of 1000 24-byte messages to a Fanout exchange
(non-persistent)
2. Dequeuing these 1000 messages using a QueueingBasicConsumer
3. Sending 1000 24-byte messages using MSMQ
4. Receiving 1000 24-byte messages using MSMQ
(All benchmarks were run using MeasureIt, a free microbenchmarking tool for
.Net code.)
Results
-------
RabbitMQ:
In the local case, published about 4K messages per second, consumed about
10K messages per second.
In the remote case, median times were the same as for local, but big
outliers occurred on some runs.
(Using BasicGet instead of QueueingBasicConsumer, I got around 1500 messages
per sec remote, 3K local)
MSMQ:
In the local case, MSMQ sent about 40K messages per second, received about
40K messages per second.
In the remote case, MSMQ sent about 33K messages per second, received about
1.2K per second.
I've run the benchmark about 50 times so far, and median times are pretty
stable, tho max time for a single Consumed message can run up to 5ms.
So, one question I have is: Is there a way to achieve MSMQ-like Send
performance using rabbitmq?
The code
--------
(This is called by the harness with hostname of the local or remote machine,
port = 5672 and a 24-byte binary message payload).
private static void AmqpWorker(string serverAddress, int basePort,
LossBullet message)
{
var exchange = "fanout";
var routingKey= "key";
var endpoint = new AmqpTcpEndpoint(serverAddress, basePort++);
var connection = new ConnectionFactory().CreateConnection(endpoint);
var channel = connection.CreateModel();
string queue = null;
channel.ExchangeDeclare(exchange, ExchangeType.Fanout);
queue = channel.QueueDeclare("q1");
channel.QueueBind(queue, exchange, routingKey, false, null);
var consumer = new QueueingBasicConsumer(channel);
LossBullet bullet = message;
timer1000.Measure("Publish fanout", 1, delegate
{
channel.BasicPublish(exchange, routingKey, null,
bullet.ToBytes());
});
BasicDeliverEventArgs eventArgs = null;
consumer.Model.BasicConsume(queue, null, consumer);
timer1000.Measure("Consume fanout", 1, delegate
{
eventArgs = consumer.Queue.Dequeue() as BasicDeliverEventArgs;
message = new LossBullet( eventArgs.Body);
consumer.Model.BasicAck( eventArgs.DeliveryTag, false);
});
}
--
View this message in context: http://www.nabble.com/Simple-benchmark-and-results-tp25968960p25968960.html
Sent from the RabbitMQ mailing list archive at Nabble.com.
More information about the rabbitmq-discuss
mailing list