SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
What we've learned from running thousands
of production RabbitMQ clusters
Lovisa Johansson
lovisa@cloudamqp.com
3000 emails
● Unstable RabbitMQ version
● Unoptimized configuration for a specific use case
➢ High availability
➢ High Performance
● Users (you?) are using RabbitMQ in a bad way
● Client libraries are using RabbitMQ in bad way
● Things are not done in an optimal way
● Customer use cases
● Configuration mistakes
● Common mistakes
Client side problems
Server side problems
What we've learned from running
thousands of production RabbitMQ
clusters
Lovisa Johansson
Marketing Manager
Support Engineer
RabbitMQ Engineer
Umeå, Sweden
23000 running instances 7 clouds
Largest provider of managed RabbitMQ servers
75 regions
Headquarter
Stockholm Sweden
Don’t use too many connections or channels
● Keep connection/channel count low
● Each connection uses about 100 KB of RAM
● Thousands of connections can be a heavy burden on a RabbitMQ server
● Channel and connections leaks are among the most common errors that we see
Recommendation number 1.
CONNECTIONS AND CHANNELS
● Long-lived connections.
● Don’t open a channel every
time you are publishing
Don’t open and close connections or channels repeatedly
● AMQP connections: 7 TCP packages
● AMQP channel: 2 TCP packages
● AMQP publish: 1 TCP package
● AMQP close channel: 2 TCP packages
● AMQP close connection: 2 TCP packages
Total 14-19 packages (+ acks)
Recommendation number 2.
CONNECTIONS AND CHANNELS
● Our benchmarks show that the proxy is increasing publishing
speed with a magnitude or more.
● https://github.com/cloudamqp/amqproxy
● Some clients can’t keep long-lived connections
(looking at you PHP )
● Avoid connection churn by using a proxy that pools
connections and channels for reuse.
AMQProxy
Flow control: Might not be able to consume if the connection is in flow control
Back pressure: RabbitMQ can apply back pressure on the TCP connection when the
publisher is sending too many messages
Separate connections for publishers and consumers
Recommendation number 3.
CONNECTIONS AND CHANNELS
● Less than 10 000 messages in one queue
● Heavy load on RAM usage
QUEUES
Recommendation number 4.
Don't have too large queues
○ In order to free up RAM, RabbitMQ starts page out messages to disk
○ Blocks the queue from processing messages
● Time-consuming to restart a cluster
● Limit queue size with TTL or max-length
● Lazy queues was added in RabbitMQ 3.6
● Writes messages to disk immediately, thus spreading the work out over time instead of taking the
risk of a performance hit somewhere down the road
● More predictable and smooth performance curve
○ Messages are only loaded into memory when they are needed.
Enable lazy queues to get predictable performance
Recommendation number 5.
QUEUES
Enable lazy queues if…
● the publisher is sending many messages at once
● the consumers are not keeping up with the speed of the publishers all the time
Ignore lazy queues if..
● you require high performance
● queues are always short
The RabbitMQ management collects and calculates metrics for every queue, connection,
and channel in the cluster
● Slows down the server if you have thousands upon thousands of active queues or
consumers
Don’t set RabbitMQ Management statistics rate mode to detailed
Recommendation number 6.
QUEUES
Split queues over different cores, and route messages to multiple
queues
Recommendation number 7.1
QUEUES
● A queue is single threaded
○ 50k messages/s
● Queue performance is limited to one CPU core.
● All messages routed to a specific queue will end up
on the node where that queue resides.
Plugins
The consistent hash
exchange plugin
RabbitMQ sharding
Recommendation number 7.2
QUEUES
● Load-balance messages between queues
● Messages are consistently and equally distributed across many queues
● Consume from all queues
● https://github.com/rabbitmq/rabbitmq-consistent-hash-exchange
The consistent hash exchange plugin
Recommendation number 7.3
QUEUES
RabbitMQ sharding
● Automatic partitioning of queues
● Queues are created on every cluster node and messages are sharded across them
● Shows one queue to the consumer, but it could be many queues running behind it in
the background
● https://github.com/rabbitmq/rabbitmq-sharding
Recommendation number 8.
QUEUES
Have limited use on priority queues
● Each priority level uses an internal queue on the Erlang VM, which takes up
resources.
● In most use cases it's sufficient to have no more than 5 priority levels.
Recommendation number 9.
QUEUES
Send persistent messages and durable queues
● Messages, exchanges, and queues that are not durable and persistent are lost
during a broker restart
● High performance - use transit messages and temporary, or non-durable queues
Recommendation number 10.1
PREFETCH
Adjust prefetch value
● Limits how many messages the client can receive before acknowledging a message
● RabbitMQ default prefetch value - unlimited buffer
● RabbitMQ 3.7
○ Option to adjust the default prefetch
○ CloudAMQP servers has a default prefetch of 1000
Recommendation number 10.2
PREFETCH
Prefetch - Too small prefetch value
RabbitMQ is most of the
time waiting to get
permission to send more
messages
Recommendation number 10.3
PREFETCH
Prefetch - Too large prefetch value
Recommendation number 10.4
PREFETCH
Prefetch
● One single or few consumers with short processing time
○ prefetch many messages at once
● About the same processing time and a stable network
○ estimated prefetch value by using the total round trip time divided by
processing time on the client for each message
● Many consumers, and short processing time
○ A lower prefetch value than for one single or few consumers
● Many consumers, and/or long processing time
○ Set prefetch count to 1 so that messages are evenly distributed among all
your workers
● The prefetch value have no effect if your client auto-ack messages
Recommendation number 11.
HiPE
HiPE
● HiPE increases server throughput at the cost of increased start-up time
○ increases throughput with 20-80%
○ increases start-up time about 1 to 3 minutes
● HiPE is recommended if you require high availability
● We don’t consider HiPE as experimental any longer
● Pay attention to where in your consumer logic you’re acknowledging messages
● For the fastest possible throughput, manual acks should be disabled
● Publish confirm is required if the publisher needs messages to be processed at
least once
Recommendation number 12.
ACKS AND CONFIRMS
Acknowledgments and Confirms
Great improvements are made to RabbitMQ, all the time <3
● 3.7
○ Default prefetch
○ Individual vhost message stores
● 3.6
○ Lots of many memory problems, up to version 3.6.14
○ Lazy queues
● 3.5
○ Still may customers on 3.5.7
Recommendation number 13.
VERSION
Use a stable RabbitMQ version
Back compatibility is
really good in RabbitMQ
● Some plugins are consuming lots of resources
● Make sure to disable plugins that you are not using
Recommendation number 14.
Plugins
Disable plugins you are not using
● Unused queues take up some resources, queue index, management statistics etc
● Temporary queues should be auto deleted
Recommendation number 15.
Unused queues
Delete unused queues
● Message loss on netsplits
● Needed to be able to upgrade without losing messages at CloudAMQP
Recommendation number 16.
VHOST
Enable HA-vhost policy on custom vhosts
Summary Overall
Server side problems
● Short queues
● Long lived connections
● Limited use of priority queues
● Use multiple queues and consumers
● Split your queues over different cores
● Stable Erlang and RabbitMQ version
● Disable plugins you are not using
● Channels on all connections
Summary Overall
Server side problems
● Separate connections for publishers and
consumers
● Management statistics rate mode
● Delete unused queues
● Temporary queues should be auto deleted
Summary High Performance
Server side problems
● Short queues
○ max-length if possible
● Do not use lazy queues
● Send transit messages
● Disable manual acks and publish
confirms
● Avoid multiple nodes (HA)
● Enable RabbitMQ HiPE
Summary High Availability
Server side problems
● Enable lazy queues
● RabbitMQ HA - 2 nodes
○ HA-policy on all vhosts
● Persistent messages, durable queues
● Do not enable HiPE
DIAGNOSTIC TOOL
DIAGNOSTIC TOOL
Diagnostics Tool
● RabbitMQ and Erlang version
● Queue length
● Unused queues
● Persistent messages in durable queues
● No mirrored auto delete queues
● Limited use of priority queues
● Long lived connections
● Connection and channel leak
● Channels on all connections
● Insecure connections
● Client library
● AMQP Heartbeats
● Channel prefetch
● Limited use of priority queues
● Management statistics rate mode
● Ensure that you are not using topic exchange as fanout
● Ensure that all published messages are routed
● Ensure that you have a HA-policy on all vhosts
● Auto delete on temporary queues
● Persistent messages in durable queues
● No transient messages in mirrored queues
● No mirrored auto delete queues
● Separate connections for publishers and consumers
It should be easier to do things
right!
Questions?
Visit www.cloudamqp.com blog site, documentation and FAQ for more info

Mais conteúdo relacionado

Mais procurados

Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesSlideTeam
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf Karsh Hamid
 
Easy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQPEasy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQPRabbit MQ
 
Integrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQIntegrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQGavin Roy
 
Comparing open source private cloud platforms
Comparing open source private cloud platformsComparing open source private cloud platforms
Comparing open source private cloud platformsOSCON Byrum
 
Full Isolation in Multi-Tenant SaaS with Kubernetes and Istio
Full Isolation in Multi-Tenant SaaS with Kubernetes and IstioFull Isolation in Multi-Tenant SaaS with Kubernetes and Istio
Full Isolation in Multi-Tenant SaaS with Kubernetes and IstioIchsan Rahardianto
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Solace
 
SnapLogic Elastic Integration Platform as a Service (iPaaS)
SnapLogic Elastic Integration Platform as a Service (iPaaS)SnapLogic Elastic Integration Platform as a Service (iPaaS)
SnapLogic Elastic Integration Platform as a Service (iPaaS)Darren Cunningham
 
CMMN makes BPMN smarter and engaging
CMMN makes BPMN smarter and engagingCMMN makes BPMN smarter and engaging
CMMN makes BPMN smarter and engagingFlowable
 
Netflix Global Cloud Architecture
Netflix Global Cloud ArchitectureNetflix Global Cloud Architecture
Netflix Global Cloud ArchitectureAdrian Cockcroft
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleKnoldus Inc.
 
OpenTelemetry For Architects
OpenTelemetry For ArchitectsOpenTelemetry For Architects
OpenTelemetry For ArchitectsKevin Brockhoff
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationSuresh Kumar
 
Big Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingBig Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingAraf Karsh Hamid
 
Unique ID generation in distributed systems
Unique ID generation in distributed systemsUnique ID generation in distributed systems
Unique ID generation in distributed systemsDave Gardner
 

Mais procurados (20)

Load balancing
Load balancingLoad balancing
Load balancing
 
Red Hat Insights
Red Hat InsightsRed Hat Insights
Red Hat Insights
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Easy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQPEasy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQP
 
Integrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQIntegrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQ
 
Comparing open source private cloud platforms
Comparing open source private cloud platformsComparing open source private cloud platforms
Comparing open source private cloud platforms
 
Full Isolation in Multi-Tenant SaaS with Kubernetes and Istio
Full Isolation in Multi-Tenant SaaS with Kubernetes and IstioFull Isolation in Multi-Tenant SaaS with Kubernetes and Istio
Full Isolation in Multi-Tenant SaaS with Kubernetes and Istio
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture
 
SnapLogic Elastic Integration Platform as a Service (iPaaS)
SnapLogic Elastic Integration Platform as a Service (iPaaS)SnapLogic Elastic Integration Platform as a Service (iPaaS)
SnapLogic Elastic Integration Platform as a Service (iPaaS)
 
CMMN makes BPMN smarter and engaging
CMMN makes BPMN smarter and engagingCMMN makes BPMN smarter and engaging
CMMN makes BPMN smarter and engaging
 
RabbitMQ
RabbitMQ RabbitMQ
RabbitMQ
 
Netflix Global Cloud Architecture
Netflix Global Cloud ArchitectureNetflix Global Cloud Architecture
Netflix Global Cloud Architecture
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
OpenTelemetry For Architects
OpenTelemetry For ArchitectsOpenTelemetry For Architects
OpenTelemetry For Architects
 
Anthos
AnthosAnthos
Anthos
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Big Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingBig Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb Sharding
 
Unique ID generation in distributed systems
Unique ID generation in distributed systemsUnique ID generation in distributed systems
Unique ID generation in distributed systems
 

Semelhante a What we've learned from running thousands of production RabbitMQ clusters - Lovisa Johansson

Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018Otávio Carvalho
 
Towards Improved Data Dissemination of Publish-Subscribe Systems
Towards Improved Data Dissemination of Publish-Subscribe SystemsTowards Improved Data Dissemination of Publish-Subscribe Systems
Towards Improved Data Dissemination of Publish-Subscribe SystemsSrinath Perera
 
Apache Kafka - Free Friday
Apache Kafka - Free FridayApache Kafka - Free Friday
Apache Kafka - Free FridayOtávio Carvalho
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaSteven Wu
 
Building zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafkaBuilding zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafkaAvinash Ramineni
 
Advanced OpenVPN Concepts on pfSense 2.4 & 2.3.3 - pfSense Hangout February 2017
Advanced OpenVPN Concepts on pfSense 2.4 & 2.3.3 - pfSense Hangout February 2017Advanced OpenVPN Concepts on pfSense 2.4 & 2.3.3 - pfSense Hangout February 2017
Advanced OpenVPN Concepts on pfSense 2.4 & 2.3.3 - pfSense Hangout February 2017Netgate
 
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache KafkaStrata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafkaconfluent
 
Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfOrtus Solutions, Corp
 
10 Things Every Developer Using RabbitMQ Should Know
10 Things Every Developer Using RabbitMQ Should Know10 Things Every Developer Using RabbitMQ Should Know
10 Things Every Developer Using RabbitMQ Should KnowVMware Tanzu
 
#4 Mulesoft Virtual Meetup Kolkata December 2020
#4 Mulesoft Virtual Meetup Kolkata December 2020#4 Mulesoft Virtual Meetup Kolkata December 2020
#4 Mulesoft Virtual Meetup Kolkata December 2020Roikka Hazarika
 
Advanced OpenVPN Concepts - pfSense Hangout September 2014
Advanced OpenVPN Concepts - pfSense Hangout September 2014Advanced OpenVPN Concepts - pfSense Hangout September 2014
Advanced OpenVPN Concepts - pfSense Hangout September 2014Netgate
 
Improving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at UberImproving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at UberYing Zheng
 

Semelhante a What we've learned from running thousands of production RabbitMQ clusters - Lovisa Johansson (20)

Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018
 
AMQP with RabbitMQ
AMQP with RabbitMQAMQP with RabbitMQ
AMQP with RabbitMQ
 
Towards Improved Data Dissemination of Publish-Subscribe Systems
Towards Improved Data Dissemination of Publish-Subscribe SystemsTowards Improved Data Dissemination of Publish-Subscribe Systems
Towards Improved Data Dissemination of Publish-Subscribe Systems
 
Apache Kafka - Free Friday
Apache Kafka - Free FridayApache Kafka - Free Friday
Apache Kafka - Free Friday
 
Working with Asynchronous Events
Working with Asynchronous EventsWorking with Asynchronous Events
Working with Asynchronous Events
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With Kafka
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With Kafka
 
Pika driver
Pika driverPika driver
Pika driver
 
Building zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafkaBuilding zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafka
 
kafka
kafkakafka
kafka
 
Advanced OpenVPN Concepts on pfSense 2.4 & 2.3.3 - pfSense Hangout February 2017
Advanced OpenVPN Concepts on pfSense 2.4 & 2.3.3 - pfSense Hangout February 2017Advanced OpenVPN Concepts on pfSense 2.4 & 2.3.3 - pfSense Hangout February 2017
Advanced OpenVPN Concepts on pfSense 2.4 & 2.3.3 - pfSense Hangout February 2017
 
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache KafkaStrata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
 
Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdf
 
Irc how to sept 2012
Irc how to   sept 2012Irc how to   sept 2012
Irc how to sept 2012
 
10 Things Every Developer Using RabbitMQ Should Know
10 Things Every Developer Using RabbitMQ Should Know10 Things Every Developer Using RabbitMQ Should Know
10 Things Every Developer Using RabbitMQ Should Know
 
#4 Mulesoft Virtual Meetup Kolkata December 2020
#4 Mulesoft Virtual Meetup Kolkata December 2020#4 Mulesoft Virtual Meetup Kolkata December 2020
#4 Mulesoft Virtual Meetup Kolkata December 2020
 
Advanced OpenVPN Concepts - pfSense Hangout September 2014
Advanced OpenVPN Concepts - pfSense Hangout September 2014Advanced OpenVPN Concepts - pfSense Hangout September 2014
Advanced OpenVPN Concepts - pfSense Hangout September 2014
 
BAXTER phase 1b
BAXTER phase 1bBAXTER phase 1b
BAXTER phase 1b
 
Improving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at UberImproving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at Uber
 
Reducing load with RabbitMQ
Reducing load with RabbitMQReducing load with RabbitMQ
Reducing load with RabbitMQ
 

Último

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Último (20)

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

What we've learned from running thousands of production RabbitMQ clusters - Lovisa Johansson

  • 1. What we've learned from running thousands of production RabbitMQ clusters Lovisa Johansson lovisa@cloudamqp.com
  • 2.
  • 3.
  • 5. ● Unstable RabbitMQ version ● Unoptimized configuration for a specific use case ➢ High availability ➢ High Performance ● Users (you?) are using RabbitMQ in a bad way ● Client libraries are using RabbitMQ in bad way ● Things are not done in an optimal way ● Customer use cases ● Configuration mistakes ● Common mistakes Client side problems Server side problems
  • 6. What we've learned from running thousands of production RabbitMQ clusters
  • 7. Lovisa Johansson Marketing Manager Support Engineer RabbitMQ Engineer Umeå, Sweden
  • 8. 23000 running instances 7 clouds Largest provider of managed RabbitMQ servers 75 regions Headquarter Stockholm Sweden
  • 9. Don’t use too many connections or channels ● Keep connection/channel count low ● Each connection uses about 100 KB of RAM ● Thousands of connections can be a heavy burden on a RabbitMQ server ● Channel and connections leaks are among the most common errors that we see Recommendation number 1. CONNECTIONS AND CHANNELS
  • 10. ● Long-lived connections. ● Don’t open a channel every time you are publishing Don’t open and close connections or channels repeatedly ● AMQP connections: 7 TCP packages ● AMQP channel: 2 TCP packages ● AMQP publish: 1 TCP package ● AMQP close channel: 2 TCP packages ● AMQP close connection: 2 TCP packages Total 14-19 packages (+ acks) Recommendation number 2. CONNECTIONS AND CHANNELS
  • 11. ● Our benchmarks show that the proxy is increasing publishing speed with a magnitude or more. ● https://github.com/cloudamqp/amqproxy ● Some clients can’t keep long-lived connections (looking at you PHP ) ● Avoid connection churn by using a proxy that pools connections and channels for reuse. AMQProxy
  • 12. Flow control: Might not be able to consume if the connection is in flow control Back pressure: RabbitMQ can apply back pressure on the TCP connection when the publisher is sending too many messages Separate connections for publishers and consumers Recommendation number 3. CONNECTIONS AND CHANNELS
  • 13.
  • 14. ● Less than 10 000 messages in one queue ● Heavy load on RAM usage QUEUES Recommendation number 4. Don't have too large queues ○ In order to free up RAM, RabbitMQ starts page out messages to disk ○ Blocks the queue from processing messages ● Time-consuming to restart a cluster ● Limit queue size with TTL or max-length
  • 15. ● Lazy queues was added in RabbitMQ 3.6 ● Writes messages to disk immediately, thus spreading the work out over time instead of taking the risk of a performance hit somewhere down the road ● More predictable and smooth performance curve ○ Messages are only loaded into memory when they are needed. Enable lazy queues to get predictable performance Recommendation number 5. QUEUES Enable lazy queues if… ● the publisher is sending many messages at once ● the consumers are not keeping up with the speed of the publishers all the time Ignore lazy queues if.. ● you require high performance ● queues are always short
  • 16. The RabbitMQ management collects and calculates metrics for every queue, connection, and channel in the cluster ● Slows down the server if you have thousands upon thousands of active queues or consumers Don’t set RabbitMQ Management statistics rate mode to detailed Recommendation number 6. QUEUES
  • 17. Split queues over different cores, and route messages to multiple queues Recommendation number 7.1 QUEUES ● A queue is single threaded ○ 50k messages/s ● Queue performance is limited to one CPU core. ● All messages routed to a specific queue will end up on the node where that queue resides. Plugins The consistent hash exchange plugin RabbitMQ sharding
  • 18. Recommendation number 7.2 QUEUES ● Load-balance messages between queues ● Messages are consistently and equally distributed across many queues ● Consume from all queues ● https://github.com/rabbitmq/rabbitmq-consistent-hash-exchange The consistent hash exchange plugin
  • 19. Recommendation number 7.3 QUEUES RabbitMQ sharding ● Automatic partitioning of queues ● Queues are created on every cluster node and messages are sharded across them ● Shows one queue to the consumer, but it could be many queues running behind it in the background ● https://github.com/rabbitmq/rabbitmq-sharding
  • 20. Recommendation number 8. QUEUES Have limited use on priority queues ● Each priority level uses an internal queue on the Erlang VM, which takes up resources. ● In most use cases it's sufficient to have no more than 5 priority levels.
  • 21. Recommendation number 9. QUEUES Send persistent messages and durable queues ● Messages, exchanges, and queues that are not durable and persistent are lost during a broker restart ● High performance - use transit messages and temporary, or non-durable queues
  • 22. Recommendation number 10.1 PREFETCH Adjust prefetch value ● Limits how many messages the client can receive before acknowledging a message ● RabbitMQ default prefetch value - unlimited buffer ● RabbitMQ 3.7 ○ Option to adjust the default prefetch ○ CloudAMQP servers has a default prefetch of 1000
  • 23. Recommendation number 10.2 PREFETCH Prefetch - Too small prefetch value RabbitMQ is most of the time waiting to get permission to send more messages
  • 24. Recommendation number 10.3 PREFETCH Prefetch - Too large prefetch value
  • 25. Recommendation number 10.4 PREFETCH Prefetch ● One single or few consumers with short processing time ○ prefetch many messages at once ● About the same processing time and a stable network ○ estimated prefetch value by using the total round trip time divided by processing time on the client for each message ● Many consumers, and short processing time ○ A lower prefetch value than for one single or few consumers ● Many consumers, and/or long processing time ○ Set prefetch count to 1 so that messages are evenly distributed among all your workers ● The prefetch value have no effect if your client auto-ack messages
  • 26. Recommendation number 11. HiPE HiPE ● HiPE increases server throughput at the cost of increased start-up time ○ increases throughput with 20-80% ○ increases start-up time about 1 to 3 minutes ● HiPE is recommended if you require high availability ● We don’t consider HiPE as experimental any longer
  • 27. ● Pay attention to where in your consumer logic you’re acknowledging messages ● For the fastest possible throughput, manual acks should be disabled ● Publish confirm is required if the publisher needs messages to be processed at least once Recommendation number 12. ACKS AND CONFIRMS Acknowledgments and Confirms
  • 28. Great improvements are made to RabbitMQ, all the time <3 ● 3.7 ○ Default prefetch ○ Individual vhost message stores ● 3.6 ○ Lots of many memory problems, up to version 3.6.14 ○ Lazy queues ● 3.5 ○ Still may customers on 3.5.7 Recommendation number 13. VERSION Use a stable RabbitMQ version Back compatibility is really good in RabbitMQ
  • 29. ● Some plugins are consuming lots of resources ● Make sure to disable plugins that you are not using Recommendation number 14. Plugins Disable plugins you are not using
  • 30. ● Unused queues take up some resources, queue index, management statistics etc ● Temporary queues should be auto deleted Recommendation number 15. Unused queues Delete unused queues
  • 31. ● Message loss on netsplits ● Needed to be able to upgrade without losing messages at CloudAMQP Recommendation number 16. VHOST Enable HA-vhost policy on custom vhosts
  • 32. Summary Overall Server side problems ● Short queues ● Long lived connections ● Limited use of priority queues ● Use multiple queues and consumers ● Split your queues over different cores ● Stable Erlang and RabbitMQ version ● Disable plugins you are not using ● Channels on all connections
  • 33. Summary Overall Server side problems ● Separate connections for publishers and consumers ● Management statistics rate mode ● Delete unused queues ● Temporary queues should be auto deleted
  • 34. Summary High Performance Server side problems ● Short queues ○ max-length if possible ● Do not use lazy queues ● Send transit messages ● Disable manual acks and publish confirms ● Avoid multiple nodes (HA) ● Enable RabbitMQ HiPE
  • 35. Summary High Availability Server side problems ● Enable lazy queues ● RabbitMQ HA - 2 nodes ○ HA-policy on all vhosts ● Persistent messages, durable queues ● Do not enable HiPE
  • 37. DIAGNOSTIC TOOL Diagnostics Tool ● RabbitMQ and Erlang version ● Queue length ● Unused queues ● Persistent messages in durable queues ● No mirrored auto delete queues ● Limited use of priority queues ● Long lived connections ● Connection and channel leak ● Channels on all connections ● Insecure connections ● Client library ● AMQP Heartbeats ● Channel prefetch ● Limited use of priority queues ● Management statistics rate mode ● Ensure that you are not using topic exchange as fanout ● Ensure that all published messages are routed ● Ensure that you have a HA-policy on all vhosts ● Auto delete on temporary queues ● Persistent messages in durable queues ● No transient messages in mirrored queues ● No mirrored auto delete queues ● Separate connections for publishers and consumers
  • 38. It should be easier to do things right!
  • 39. Questions? Visit www.cloudamqp.com blog site, documentation and FAQ for more info