We have a situation where we have a single RabbitMQ node in US-East, with producers in other zones (Ireland, Sydney etc). We are seeing huge performance hits when queueing from other zones. Sydney -> US-East queue is 1s to queue a message, whereas queuing Sydney -> Sydney is 50ms. It seems a lot of the time is spent creating the channel and declaring the queue.
What options do we have to improve the performance? Could we look at some sort of distributed RabbitMQ cluster, with a node in each region? Would that help us?
Here's the code we are using to test:
var queueConnection = amqp.connect("OUR amqp servers in each region")
var queueName = "test-queue"
var queueMessage = function(message) {
return queueConnection.then(function(conn) {
return conn.createChannel()
}).then(function(ch) {
var queue = ch.assertQueue(queueName, { durable: false });
return queue.then(function() {
ch.sendToQueue(queueName, new Buffer(JSON.stringify(message)), { deliveryMode: true });
return ch.close()
});
})
};
Promise.map(_.range(0, 10), function(item) {
var timedQueueMessage = timely.promise(queueMessage)
return timedQueueMessage({ name: "Dom" }).then(function(res) {
console.log("Completed in " + timedQueueMessage.time + "ms")
})
}, { concurrency: 10 }).done(process.exit)
For these use cases you should look at Federation or Shovel.
This page explains the pros and cons of each of the distributed options offered by RabbitMQ: http://www.rabbitmq.com/distributed.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With