[erlang-questions] Rabbit under small load

41 views
Skip to first unread message

Max Bourinov

unread,
May 24, 2013, 4:28:54 AM5/24/13
to erlang-questions
Hello Dear Erlangers!

I have about 3000 erlang-processes which should send messages to AMQP-queue of destination and receive replies from it.

The message rate at the moment is about 100 M/s
Average message size: 4 Kb

At the moment I have one locally registered gen_server that does all communication with RabbitMQ. It consumes messages and routes them to corresponding worker processes (via gproc). When worker process need to send something, it cast message to RabbitMQ process via local name.  With this approach I see some problems with message consumption speed.

What is the right way to interact with RabbitMQ server in Erlang code? Should it be more consumer processes?

Best regards,
Max

Jesper Louis Andersen

unread,
May 24, 2013, 7:15:25 AM5/24/13
to Max Bourinov, erlang-questions


On May 24, 2013, at 10:28 AM, Max Bourinov <bour...@gmail.com> wrote:

> Hello Dear Erlangers!
>
> I have about 3000 erlang-processes which should send messages to AMQP-queue of destination and receive replies from it.
>
> The message rate at the moment is about 100 M/s
> Average message size: 4 Kb
>

Is that 100 * 1000 * 1000 messages per second or 100 messages per second?

RabbitMQ should easily be able to handle the latter load without much trouble. I have built a gen_server as a middle-man for RabbitMQ which handles the request/reply toward RMQ more or less like your approach and I can easily do 6000 messages per second with this setup and very little to no tuning. I don't know where the limit to that solution is, but there is a one-core bottleneck in the gen_server.

100 million messages is a different question however. Given the average message size, you are at 400 megabytes per second and hence you need 4 Gigabit of bandwidth to even hope hitting target. Apart from that, I don't think RMQ can handle that amount of load. You may need something else entirely to handle that.

Jesper Louis Andersen
Erlang Solutions Ltd., Copenhagen

_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Yogish Baliga

unread,
May 24, 2013, 1:04:59 PM5/24/13
to Max Bourinov, erlang-questions
Single RabbitMQ server cannot handle your load requirement. You need to setup multiple RabbitMQ servers and handle shard the messages across multiple servers.

-- baliga


Tim Watson

unread,
May 24, 2013, 1:18:30 PM5/24/13
to Yogish Baliga, erlang-questions
Nonsense. He hasn't stated what his target throughput actually is, so how can you say that?

Tim Watson

unread,
May 24, 2013, 1:49:20 PM5/24/13
to Jesper Louis Andersen, erlang-questions
On 24 May 2013, at 12:15, Jesper Louis Andersen <jesper.lou...@erlang-solutions.com> wrote:

>
> 100 million messages is a different question however. Given the average message size, you are at 400 megabytes per second and hence you need 4 Gigabit of bandwidth to even hope hitting target. Apart from that, I don't think RMQ can handle that amount of load. You may need something else entirely to handle that.
>

I'm pretty sure what he said was that he's currently handling 100 M/s, which probably fits the "messages per second" guess, since as you point out, rabbit has not been demonstrated to go anywhere near 1millions messages per second.

Is your gen_server wrapper open source btw?

Max Bourinov

unread,
May 24, 2013, 3:59:28 PM5/24/13
to Tim Watson, erlang-questions
>> At the moment I have 100 messages per second.

It is only 100-500 messages per second.

Best regards,
Max

Reply all
Reply to author
Forward
0 new messages