We have a situation where we have one RabbitMQ node in the USA-East, with manufacturers in other zones (Ireland, Sydney, etc.). We are seeing enormous impacts of productivity when queuing from other zones. Sydney → US-East queue - 1 s to queue a message, while Sydney → Sydney - 50 ms. It seems like a lot of time is spent creating a channel and queuing up.
What parameters should we improve? Can we look at some kind of distributed RabbitMQ cluster with node in each region? It will help us?
Here is the code we use for testing:
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)
source share