DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Rust’s Ownership and Borrowing Enforce Memory Safety
  • What Are Protocol Buffers?
  • Troubleshooting Memory Leaks With Heap Profilers
  • Getting Deep Into C++ Pointers

Trending

  • Part 4: Multi-Agent Orchestration — Pairing Goose With Quarkus Flow State Machines
  • The Three Tiers of Agentic Incident Response: When to Trust AI Autonomy
  • New York City Taxi Trips: Putting Neo4j and DuckDB to Work
  • Member Spotlight: Shai Almong

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Data
  4. How Many Queues Are Best For Max Performance? RabbitMQ

How Many Queues Are Best For Max Performance? RabbitMQ

By 
Mitch Pronschinske
·
Jan. 16, 13 · Interview
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
19.3K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in
A generally useful question posed by Charming asks how many queues one should use in RabbitMQ for the maximum message passing throughput/performance.  I thought I'd distill the answers by Brian Kelly and RobotEyes here for anyone who's worried about their performance with RabbitMQ.  And I'll bet that some of these pointers are relevant to other message queues as well:

From the RabbitMQ blog:

RabbitMQ's queues are fastest when they're empty. When a queue is empty, and it has consumers ready to receive messages, then as soon as a message is received by the queue, it goes straight out to the consumer. In the case of a persistent message in a durable queue, yes, it will also go to disk, but that's done in an asynchronous manner and is buffered heavily. The main point is that very little book-keeping needs to be done, very few data structures are modified, and very little additional memory needs allocating.

From the rabbitmq-discuss mailing group:

  • Use a larger prefetch count. Small values hurt performance.
  • A topic exchange is slower than a direct or a fanout exchange.
  • Make sure queues stay short. Longer queues impose more processing overhead.
  • If you care about latency and message rates then use smaller messages. Use an efficient format (e.g. avoid XML) or compress the payload.
  • Experiment with HiPE, which helps performance.
  • Avoid transactions and persistence. Also avoid publishing in immediate or mandatory mode. Avoid HA. Clustering can also impact performance.
  • You will achieve better throughput on a multi-core system if you have multiple queues and consumers.
  • Use at least v2.8.1, which introduces flow control. Make sure the memory and disk space alarms never trigger.
  • Virtualisation can impose a small performance penalty.
  • Tune your OS and network stack. Make sure you provide more than enough RAM. Provide fast cores and RAM.


Hope that gives you some ideas for improving your queueing performance.

Message passing consumer Memory (storage engine) Pointer (computer programming) Data (computing) Overhead (computing) Space (architecture) Data Types

Opinions expressed by DZone contributors are their own.

Related

  • Rust’s Ownership and Borrowing Enforce Memory Safety
  • What Are Protocol Buffers?
  • Troubleshooting Memory Leaks With Heap Profilers
  • Getting Deep Into C++ Pointers

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook