Skip to content
Search our site for answers
Login
  • Help Docs
  • API Docs
  • liquidweb.com
  • Hosting Services
    • Cloud VPS Hosting
    • Dedicated Servers
    • GPU Hosting
    • Hosting For WordPress
    • Hosting For WooCommerce
    • Email Hosting
    • VMware Hosting
    • Add-ons
  • Security & Compliance
    • SSL Certificates
    • Firewalls
    • Cloud Hosting
    • Two Factor Authentication
    • DDoS Protection
    • Compliance
    • Malware Protection
  • Domain & DNS
    • Domain Registration
    • DNS Settings
    • Nameservers
    • Subdomains
    • Domain Forwarding
    • Email DNS Setup
  • Account & Billing
    • Account Setup
    • Payment Methods
    • Billing Cycles
    • Refunds Cancellations
    • Invoices Receipts
    • Account Security
  • Email Hosting
    • Email Setup
    • Email Forwarding
    • Spam Protection
    • Microsoft 365
    • G Suite Setup
    • Account Security
    • Email Troubleshooting
  • Performance & Optimization
    • Server Optimization
    • Caching Strategies
    • Content Delivery Network
    • Database Performance
    • Image Optimization
  • Server Administration
    • Server Setup
    • SSH Access
    • Command Line Basics
    • Database Management
    • CRON Jobs
    • Apache Nginx Setup
    • Log Analysis
  • CMS & Applications
    • WordPress
    • WooCommerce
    • Magento
    • Joomla
    • Drupal
  • Backups & Recovery
    • Backup Strategies
    • Cloud Backups
    • Disaster Recovery
    • Restoring Backups
    • Raid Configurations
  • Reseller & Partner Support
    • Reseller Program
    • White Label Hosting
    • Partner Portal
    • Client Management
  • Policies & Compliance
    • Terms Of Service
    • Privacy Policy
    • GDPR Compliance
    • Acceptable Use Policy
Help Docs Control Panel Guides Nexcess Control Panel Nexcess Managed Magento Nexcess Managed Magento Store Management RabbitMQ & Magento 2 on Managed Hosting by Nexcess

RabbitMQ & Magento 2 on Managed Hosting by Nexcess

Learn to enable the RabbitMQ container for Magento 2 on Nexcess. This guide covers `env.php` configuration and managing message queue consumers.
Client Portal Data Migration Nexcess WooCommerce WordPress
7 min read

 

Before explaining the process of enabling and configuring RabbitMQ/Magento 2, let us understand what containers and RabbitMQ are in term of cloud technology.

Containers
Containers are units of software that can be added to your cloud solution to expand performance, functionality, and management. Containers are lightweight, secure, and external instances that will not take resources from your main cloud solution.

RabbitMQ & Magento 2

RabbitMQ is an open source message broker that helps websites to exchange data between processes, applications, and servers. This cloud technology item can help reduce load and delivery times by delegating tasks to a third party.

Nexcess provides the RabbitMQ cloud container service option for our Managed Applications (MA) Magento Plans. This article will cover how to optimally configure RabbitMQ for Magento 2 after enabling the corresponding option via my.nexcess.net.

Enabling the Magento 2 RabbitMQ Container

To learn how to enable the RabbitMQ container, check out the How to enable containers in Nexcess Cloud article. Once you enable the RabbitMQ container, you will receive details shown in the screenshot below related to the service.

Endpoint, Port, Username

Click on View Password option to find its related password. You will need that password information in the next step of configuring the service.

Configuring the Magento 2 RabbitMQ Container

To configure the service, you need to edit “/home/username/sitename/html/app/etc/env.php” file.

In that file you, will see below section of code:

  'queue' => [
        'consumers_wait_for_messages' => 1
    ],

You have to edit the code as follows:

   'queue' => [
        'amqp' => [
            'host' => 'Endpoint',
            'port' => 'port-number',
            'user' => 'username',
            'password' => 'password',
            'virtualhost' => '/'
        ],
        'consumers_wait_for_messages' => 1
    ],

Make sure you have entered the correct values in the host, port, user, and password areas. Then save that file and run the below command to apply the changes:

php bin/magento setup:upgrade

That’s it! You have successfully enabled and configured RabbitMQ Magento 2 on Nexcess!

Manage Message Queues

You can manage message queues from the command line using cron jobs to ensure that consumers retrieve messages.

Process Management

Cron jobs are the default mechanism to restart consumers. Processes started by cron consume the specified number of messages and then terminate. Rerunning cron restarts the consumer.

The following example shows the Magento crontab configuration for running consumers.

Path of cron job related to Message Queue:


vendor/magento/module-message-queue/etc/crontab.xml

$ cat vendor/magento/module-message-queue/etc/crontab.xml 
<?xml version="1.0"?>
<!--
  ~ Copyright (c) Magento, Inc. All rights reserved.
  ~ See COPYING.txt for license details.
  -->
<config xmlns_xsi="http://www.w3.org/2001/XMLSchema-instance" xsi_noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job name="messagequeue_clean_outdated_locks" instance="MagentoFrameworkMessageQueueLockWriterInterface" method="releaseOutdatedLocks">
            <schedule>0 * * * *</schedule>
        </job>
    </group>
    <group id="consumers">
        <job name="consumers_runner" instance="MagentoMessageQueueModelCronConsumersRunner" method="run">
            <schedule>* * * * *</schedule>
        </job>
    </group>
</config>

How often you check message queues depends on your business logic and available system resources. In general, you’ll probably want to check for newly created customers and send welcome emails more frequently than a more resource-intensive process (for example, updating your catalog). It would be best if you defined cron schedules according to your business needs.

Cron schedules
Cron schedules can be configured in Admin Panel Stores > Settings > Configuration > Advanced > System > Cron configuration options for group: consumers

To learn how to configure cron jobs for Magento 2, check out the How to configure Magento 2 cron jobs article.  

Configuration

The configuration behaviors by default are:

  • The cron job consumers_runner is enabled.
  • The cron job consumers_runner runs all defined consumers.
  • Each consumer processes 10000 messages and then terminates.

Specific Configuration

Edit the /app/etc/env.php file to configure the cron job consumers_runner:

...
    'cron_consumers_runner' => [
        'cron_run' => false,
        'max_messages' => 20000,
        'consumers' => [
            'consumer1',
            'consumer2',
        ]
    ],
...

Definitions:

  • cron_run – A boolean value that enables or disables the consumers_runner cron job (default = true).
  • max_messages – The maximum number of messages each consumer must process before terminating (default = 10000). Although we do not recommend it, you can use 0 to prevent the consumer from terminating. See consumers_wait_for_messages to configure how consumers process messages from the message queue.
  • consumers – An array of strings specifying which consumer(s) to run. An empty array runs all consumers.

View a List of Available Message Queue Consumers

To view a list of all consumers, run the following command:

bin/magento queue:consumers:list

Start Message Queue Consumers

To start message queue consumers, run the following command: 

bin/magento queue:consumers:start [--max-messages=<value>] [--batch-size=<value>] [--single-thread] [--area-code=<value>] <consumer_name>


After consuming all available messages, the command terminates. You can run the command again manually or with a cron job. You can also run multiple instances of the magento queue:consumers:start   command to process large message queues. For example, you can append & to the command to run it in the background, return to a prompt, and continue running commands:

bin/magento queue:consumers:start <consumer_name> &


Common RabbitMQ Mistakes & How to Avoid Them

Common Mistake #1: Don’t use too many connections or channels 

Try to keep the connection/channel count low. For example, use separate connections to publish and consume. Ideally, you should have one connection per process; and use one channel per thread in your application.

How best to reuse connections:

  • One connection for publishing
  • One connection for consuming

Common Mistake #2: Don’t have queues that are too large or too long

Short queues are fastest; when a queue is empty, and it has consumers ready to receive messages, as soon as a message is received, it goes straight out to the consumer.

Common Mistake #3: Don’t have an unlimited prefetch value


A typical mistake is to have an unlimited prefetch value, where one client receives all messages. This configuration can lead to the client running out of memory and crashing, and then all messages are redelivered.

Common Mistake #4: Don’t ignore lazy queues

Use lazy queues to achieve predictable performance or when you have large queues. Lazy queues create a more stable cluster with more predictable performance. Your messages will not, without warning, get flushed to disk.

Common Mistake #5: Use multiple queues and consumers

Achieve better throughput on a multi-core system with multiple queues and consumers. You will achieve optimal throughput if you have as many queues as cores on the underlying node(s).

Conclusion

Successfully integrating RabbitMQ with Magento 2 on the Nexcess platform involves a straightforward process of enabling the container, retrieving the necessary credentials, and accurately updating the app/etc/env.php file. Beyond this initial setup, effective management of the message queues is critical, requiring proper configuration of the consumers_runner cron job and an understanding of the available CLI commands to control consumers. By following these configuration steps and adhering to best practices—such as limiting connections, managing prefetch values, and using lazy queues—developers can ensure a stable, high-performance system that leverages RabbitMQ to optimize their Magento 2 store’s asynchronous processing and scalability.

Was this article helpful?
Thank you for your input.
Thank you for your feedback.
Table of Contents
  • RabbitMQ & Magento 2
  • Enabling the Magento 2 RabbitMQ Container
  • Configuring the Magento 2 RabbitMQ Container
  • Manage Message Queues
  • Process Management
  • Configuration
  • Specific Configuration
  • View a List of Available Message Queue Consumers
  • Start Message Queue Consumers
  • Common RabbitMQ Mistakes & How to Avoid Them
  • Conclusion
Essential hosting resources to help your business stay ahead
Get the guides
Related hosting content
  • Magento 2 Shipping Table Rates: Complete Setup Guide
  • Step by step Mailchimp installation for Magento 2
  • How to write redirect (301) rules for Magento…

Hosting

  • Cloud Hosting
  • Dedicated Hosting
  • Email Hosting
  • GPU Hosting
  • Magento Hosting
  • Reseller Hosting
  • VPS Hosting
  • Hosting for WordPress

Additional Hosting

  • Add-ons
  • Agency Hosting
  • Application Hosting
  • Database Hosting
  • Ecommerce Hosting
  • Enterprise Hosting
  • Freelancer Hosting
  • High Availability
  • High Performance
  • HIPAA Hosting
  • PCI Compliant Hosting
  • Private Cloud Hosting
  • Server Clusters
  • Small Business Hosting
  • VPS Reseller Hosting
  • Windows Hosting
  • Windows VPS Hosting
  • Linux VPS Hosting
  • Ubuntu VPS Hosting
  • cPanel VPS Hosting
  • KVM VPS Hosting
  • WooCommerce Hosting

Servers

  • Bare Metal Servers
  • Cloud Dedicated Servers
  • Cloud VPS
  • Custom Servers
  • Dedicated Servers
  • Managed Cloud
  • Gaming Server
  • Windows Servers

Managed Hosting

  • Managed ExpressionEngine
  • Managed Craft CMS
  • Managed Cloud
  • Managed Hosting
  • Managed Hosting for WordPress
  • Managed Magento
  • Managed Servers
  • Managed VPS
  • Managed WooCommerce

Studies

  • Every Second Counts
  • Impact of Downtime
  • Hypergrowth Hosting

Resources

  • API
  • Hosting Coupons
  • Blog
  • Customer Stories
  • Ebooks
  • Help Docs
  • Migrations
  • Sitemap
  • SSL Checker
  • Webinars
  • Web Hosting Tools
  • White Papers
  • What is my IP

Hosting Basics

  • Bare Metal
  • Cloud Hosting
  • Dedicated Servers
  • Gaming VPS
  • GPUs
  • Private Cloud
  • VPS
  • Web Hosting

Partnerships

  • Hosting Affiliate Program
  • Partner Programs
  • Refer-a-Friend

Software & Design Solutions

  • GiveWP
  • IconicWP
  • Kadence WP
  • LearnDash
  • MemberDash
  • Modern Tribe
  • Restrict Content Pro
  • SolidWP
  • The Events Calendar

Get Help

  • Chat
  • Sales
  • Support

Company

  • About
  • Careers
  • Data Centers
  • Hosting Prices
  • News
  • Policies
  • Privacy Policy
  • Security
  • Terms and Conditions
  • Web Hosting Deals

Liquid Web, a web hosting company with 18 data centers globally

HostingAdvice.com logo
Liquid Web reviewLiquid Web review

© 2026 Liquid Web, LLC

Privacy Policy

* Promotions may be exclusively available to new customers and cannot be applied to existing accounts. Qualification is at the sole discretion of Liquid Web. Reach out with questions.

  • Solutions
    • Solutions by industry
      Ecommerce

      Secure, compliant infrastructure for regulated online sales

      Financial Services

      High-trust hosting built for security and compliance

      Agencies

      Fast, flexible hosting for high-traffic client projects

      Healthcare

      HIPAA-ready environments for protected health data

      Solutions by outcomes
      Compliance

      Hosting aligned with HIPAA, PCI, GDPR, and audit readiness

      Launch

      Configure a high-performance server in minutes

      Commerce Scale

      Infrastructure built to handle surges, orders, and growth

      Disaster Recovery

      Redundant, resilient systems for rapid recovery and uptime

  • VPS Hosting
    • VPS Packages
      Cloud VPS Hosting
      Windows VPS Hosting
      Linux VPS Hosting
      Add-ons & Backups
      View All VPS Hosting
  • Dedicated Servers
    • Bare Metal Packages
      Bare Metal Servers
      Cloud Metal Packages
      Managed Dedicated
      Gaming Servers
      View All Dedicated Servers

  • Managed Hosting
    • Managed Hosting
      Managed Servers
      Managed Applications
  • WordPress
    • Hosting for WordPress
      Managed Hosting for WordPress
      VPS for WordPress
      Dedicated WordPress
      WooCommerce Hosting
  • GPU Hosting
    • GPU Hosting
      NVIDIA GPU Hosting
      AI Training & Interface

  • Products
    • Compute
      Cloud Servers

      Scalable, high-speed compute

      Dedicated Servers

      Reliability, power, and control

      Private Cloud

      Isolated, enterprise-grade cloud

      GPU

      Accelerated for AI & ML

      Containers

      Portable workloads for any app

      Platform services
      Cloud Storage

      Storage for growing data needs

      Backups & DR

      Protection for critical workloads

      Global Private Fabric

      Unify networks across servers

      Security & Protection

      Advanced defense for data

      Load Balancing

      Optimized traffic distribution

      Applications
      WordPress

      Optimized for fast, secure sites

      WooCommerce

      Performance for scalable stores

      Magento

      Commerce-ready, built to scale

Log in
  • System status
  • Support | Get Help