Answer the question
In order to leave comments, you need to log in
Why does Rabbitmq start to slow down when sending a large number of concurrent requests?
Checking the performance of rabbitmq.
I send from 10 thousand to 100 thousand messages to the queue. Everything is fine, it is inserted at about 4 thousand / sec.
I increase the number to send from 100 thousand to 200 thousand. All rabbitmq starts to work very slowly, about 100-200 requests per second are inserted.
var amqp = require('amqplib');
var when = require('when');
amqp.connect().then(function(c) {
var num = 100000;
var cnt = 0;
function mkCallback(i) {
return function(err) {
cnt++
if (i % 1000 == 0) {
console.log(i)
}
if (err !== null) {
console.error('Message %d failed!', i);
} else {
// console.log('Message %d confirmed', i);
}
if (cnt == num) {
c.close()
}
}
}
c.createConfirmChannel().then(function(ch) {
var queueName = 'mytest'
var common_options = {
durable: true,
noAck: false
};
ch.assertQueue(queueName, common_options);
for (var i = 0; i < num; i++) {
ch.sendToQueue(queueName, new Buffer('blah'), {
'deliveryMode': 2
}, mkCallback(i));
}
// ch.waitForConfirms().then(function() {
// console.log('All messages done');
// c.close();
// }, console.error);
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question