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
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  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

Mitch Pronschinske user avatar by
Mitch Pronschinske
·
Jan. 16, 13 · Interview
Like (0)
Save
Tweet
Share
17.48K Views

Join the DZone community and get the full member experience.

Join For Free
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.

Popular on DZone

  • What Is Policy-as-Code? An Introduction to Open Policy Agent
  • SAST: How Code Analysis Tools Look for Security Flaws
  • Mr. Over, the Engineer [Comic]
  • Why Open Source Is Much More Than Just a Free Tier

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: