0

I'm using MassTransit 7 with the RabbitMQ Transport layer.

When I publish messages using MassTransit bus (whether a direct or fanout exchange which the queue already bound), the exchange rate is between 1000-1500 m/s compared to 15k-25k m/s when I publish messages using RabbitMQ client.

I also discard awaitable task when publishing so it doesn't wait for a consumer to ack:

_ = bus.Publish(new Request() { Timestamp = now });

I'm wondering if I miss something or MassTransit can't be configured for publishing at a high rate.

Mehrdad Kamali
  • 87
  • 3
  • 13

1 Answers1

1

You can measure performance using MassTransit's Benchmark, which should give you some idea on publish performance.

For reference, I get typically 16k+ messages per second, non-durable without publisher confirmations. That's on a local docker image running RabbitMQ running the benchmark from the console.

It depends what you are doing with the message, vs just raw "send a tiny payload test" with the RMQ client.

Chris Patterson
  • 28,659
  • 3
  • 47
  • 59
  • Thank you but correct me if I wrong. I ran the benchmark before with it default value that has 100 client which means multiple publishers in different threads. when one publisher (1 client) used the message rate is between 700-800 which is very slow. – Mehrdad Kamali Mar 17 '21 at 11:52
  • Neither of the benchmark scenarios are optimized for "send from one thread as fast as you can." – Chris Patterson Mar 17 '21 at 12:56