Scaling Mautic queue workers

Running Mautic messenger consumers at volume means choosing a transport, keeping workers alive under Supervisor or systemd, and handling failures so queued messages are retried or kept, not lost.

On this page

Why Mautic queue workers need planning before volume arrives

A marketing operations team usually notices a queue problem when a send that finished in minutes starts taking hours, or when a campaign reaches contacts a day late. The cause is rarely the email itself. Mautic hands queued email to a messenger consumer, and the cron jobs that update segments, advance campaigns and fire campaign triggers feed work into that pipeline. As the contact list and the number of active campaigns grow, the question becomes how many consumers run, which transport carries their messages, how the processes are supervised, and what happens when a message fails. Those are infrastructure decisions, and they are much cheaper to make before a large send than during one.

Plan this work now if any of the following applies: you run large broadcasts to segments of many thousands of contacts, several campaigns fire triggers at the same time, or the queue length grows after each scheduled run and does not drain. Each of these means messages are waiting on consumers that may be too few, stopped, or failing silently. Start by listing which cron jobs and which consumers your instance depends on, confirm the schedule with the Mautic cron jobs documentation, and record how long your queues take to clear today. Then ask your team what happens to a message that fails twice: whether it is retried, parked for review, or lost. The answers decide the transport, the process manager and the failure handling covered in the sections below.

Choosing a messenger transport: Doctrine, Redis, AMQP, Beanstalkd or Amazon SQS

The Doctrine transport stores queued messages in a table in the Mautic database, so it needs no additional service. It suits smaller volumes, single-server installations and teams that want the fewest moving parts. The trade-off is that worker polling and message writes land on the same database that serves the application, so the database needs headroom during campaign and broadcast peaks.

  • Operations: Nothing beyond the existing database, but your team owns table growth and cleanup of processed messages.
  • Backups: Queued work lives in the database, so a database backup also captures pending messages.
  • Load: Constant polling adds read and write traffic to the primary database, which can compete with page loads and imports.
  • Monitoring: Track the size of the queue table and the age of the oldest pending row with your existing database tooling.

Confirm the transport setting, table handling and worker guidance for your Mautic version in the Mautic cron jobs documentation before you rely on this option.

Configuration options and when each fits

This table compares the worker settings that change how Mautic messenger consumers behave under load, with the situations where each setting fits and its trade-off. Read each row as a decision: pick the value that matches your volume, your tolerance for duplicate or delayed sends, and your server capacity, then confirm exact configuration keys for your release line.

SettingWhen it fitsTrade-off to weigh
Transport DSN (Doctrine, Redis, AMQP, Beanstalkd or Amazon SQS)Doctrine suits small sites with low queue volume and no extra service to run. Redis, AMQP, Beanstalkd or SQS suit higher volume and separate worker hosts.Doctrine adds load to the database that also serves the web app. External brokers add a service to secure, monitor and back up.
Number of consumer processesRaise the count when queued email or hits back up while CPU and database have headroom. Keep it low on shared or small servers.More consumers drain queues faster but compete for database connections, memory and mail provider rate limits.
Memory or message limit per workerSet limits when workers run long and memory grows over time, so each process restarts cleanly before it exhausts memory.Low limits cause frequent restarts and brief gaps in consumption. High limits risk a leaking process growing until the host swaps or kills it.
Retry countUse a few retries for transient failures such as a mail provider timeout or a briefly unavailable database.Too many retries delay the failure queue and can resend messages that already reached the recipient if the failure happened after send.
Retry delayUse a longer delay when the failing dependency needs time to recover, such as a rate-limited SMTP relay or an external CRM.Long delays keep time-sensitive messages waiting. Short delays can hammer a service that is already struggling.
Failure transportRoute messages that exhaust retries to a separate transport so they can be inspected, replayed or discarded deliberately.Someone must watch the failure queue. Without a review routine, failed messages sit unnoticed and the loss is silent.
Process supervision (Supervisor or systemd)Use a supervisor when consumers must restart automatically after crashes, reboots or memory-based exits.A misconfigured supervisor can restart a broken consumer in a loop. Confirm the exact settings with the Mautic docs for your release line before you rely on them.

How to set up messenger consumers under Supervisor or systemd

This sequence moves Mautic's queued email and hit processing from a manual or unsupervised setup to supervised consumers on a chosen transport. It ends with a tested send, a visible failure queue and a written record of each check.

  1. Confirm cron jobs and broadcasts are staggered

    Before touching the workers, review the crontab entries for segment updates, campaign updates, campaign triggers and the broadcasts command on the host that runs Mautic. The Mautic cron jobs documentation says these jobs should be staggered, so avoid starting heavy jobs in the same minute. The platform engineer should record each job with its start time and host. This step is done when the written schedule shows no two heavy jobs starting together.

  2. Choose and provision the transport

    Select a transport your team can operate: Doctrine, Redis, AMQP, Beanstalkd or Amazon SQS. Doctrine needs no extra service but places queue traffic in the database, while the others add a broker or managed queue to monitor, back up and secure. Confirm in your release's documentation which transports it supports, then provision the service with network access limited to the Mautic hosts. This step is done when the queue is reachable from a Mautic host and a test message can be sent and read with the service's own tools.

  3. Set the messenger DSN

    Add the messenger connection string to Mautic's local configuration so the email and hit consumers read from the transport you chose. The key name and DSN format vary by release and transport, so copy them from the configuration reference for your version and avoid older forum posts. Clear the Mautic cache after the change and run the configuration check from the command line. This step is done when the output shows the intended transport and no connection errors appear.

  4. Define the consumer as a supervised service

    Write a Supervisor program file or a systemd unit that runs the messenger consumer command from the Mautic project directory as the web server user. Enable restart on failure, and set the working directory, PHP binary path and log file path explicitly. Supervisor reads program files from its conf.d directory, while systemd reads unit files from /etc/systemd/system with Restart=always. Confirm the exact consumer command name for your release, and check that cache and log folders are writable by that user. This step is done when the file validates and lists the command, user and restart policy.

  5. Start the consumers

    Load the new definition and start the workers. With Supervisor, run supervisorctl reread and supervisorctl update, then check status. With systemd, run systemctl daemon-reload, enable the unit and start it, then check status. Watch the log through the first period of queued traffic and confirm each worker is waiting for messages without repeated errors. This step is done when every expected worker reports as running and the log shows no repeated connection or permission errors.

  6. Verify a test email is consumed

    Send a test email through the email builder or a broadcast to a test contact whose address you control. Watch the queue depth and the consumer log while the message moves through the transport. The message should leave the queue, be sent by the consumer and arrive in the test mailbox. This step is done when the test email arrives and the queue returns to the depth it had before the send.

  7. Confirm the failure queue is reachable

    In a non-production environment, force a controlled failure, such as pointing a test consumer at an unreachable mail server or sending to a deliberately invalid transport path. Confirm the message retries under your retry policy and then lands in the failure transport. Use the messenger failure commands in your release to list the failed message and retry it, then restore the correct settings. This step is done when the failed message is visible in the failure queue and a retry completes successfully.

Retry strategy and a failure queue so messages are not lost

Five decisions determine whether a failed Mautic message is retried, parked for review or lost. Each depends on your transports, your email and CRM providers and your monitoring, so confirm the values in a staging environment that mirrors production load before you rely on them.

Retry count before failure

Decide how many delivery attempts a message gets before it moves to the failure transport. A low count sends brief faults, such as an SMTP outage or a database lock, to the failure queue too early. A high count keeps a broken message cycling and delays healthy traffic behind it. Set the limit per transport, because an email send and a CRM sync fail for different reasons. Confirm the value by forcing a failure in staging and checking which queue the message lands in.

Backoff between attempts

Choose the delay between attempts so retries spread out instead of hammering a provider that is already struggling. Short fixed delays suit brief network blips, while growing delays give a rate-limited mail provider or CRM time to recover. Agree on the starting delay, the growth factor and the maximum delay. A maximum that is too long can hide a stuck worker for hours. Check the timing against the throttling rules of each external service Mautic sends to.

Inspecting and replaying failures

Agree who reviews failed messages, how often, and how they are replayed. A useful failed message shows enough detail to identify the contact, campaign step or integration it came from. Replay only after the cause is fixed, because replaying into the same fault refills the failure queue. Confirm the console commands for listing, retrying and removing failed messages in the docs for your Mautic version, and record who may delete messages permanently.

Alerting on failure queue growth

Alert on failure queue depth and on the age of the oldest failed message, not only on whether worker processes are running. A consumer can be up and still failing every message. Route the alert to the team that owns email delivery and the CRM integration, and link it to a short runbook. Test the alert by deliberately sending a message to the failure transport. Ask your platform or monitoring team which metric they can read from your chosen transport.

Restarts and host reboots

Confirm what happens to messages in progress when a consumer stops during a deploy, a crash or a host reboot. A graceful stop usually lets the current message finish, while a hard kill can leave it unacknowledged until the transport redelivers it. That can produce a duplicate email or CRM push, so check that both tolerate a second attempt. Test a restart under load, and keep Supervisor or systemd set to restart consumers after a reboot. The Mautic cron jobs docs cover the consumer setup.

How cron, the queue and consumers move a message from send to delivery

The flow starts with cron, which runs the broadcasts command for segment emails and the campaign commands on a schedule. Mautic then writes each message to the configured messenger transport instead of sending it inline. A supervised consumer pulls messages from that transport and hands them to the email transport. Accepted messages complete. Messages that still fail after retries move to the failure transport, where an operator reviews them before replaying. Check each hand-off in this order when a send stalls.

Message path from scheduled command to delivery or failure review.

Security and operational considerations for worker hosts

Consumers that run queued Mautic messages sit on the same hosts as the web application, so their accounts, credentials, network paths, logs and file permissions need the same attention as the web tier. The cards below cover the checks that most often cause silent failures or exposure when workers run at volume.

Run consumers under a least-privilege account

Run the messenger consumer under a dedicated system account rather than root or the web server user where your layout allows it. The account should read the Mautic code and configuration it needs, write only to the cache, logs and var directories it must update, and have no shell login. Confirm which user your web server and cron jobs use, because mismatched users are the usual cause of files that one process cannot touch.

Mautic cron jobs docs

Protect transport credentials

Redis passwords, broker credentials and AWS keys for SQS sit in the environment or local configuration that the consumer reads at start. Keep them out of shared repositories and world-readable files, restrict the file permissions to the consumer account, and rotate them through your normal secrets process. For SQS, prefer an instance role or short-lived credentials over long-lived access keys if your hosting allows it, and confirm which option your Mautic version supports.

Restrict network paths to the transport

Allow the worker hosts to reach the queue backend on its service port only, and block that port from other networks. For Redis, AMQP and Beanstalkd, bind the service to a private interface and enable authentication or TLS where the product supports it. Test the path from each worker host after any firewall or security group change, because a blocked connection often appears as a consumer that starts but processes nothing.

Set log retention for worker output

Supervisor and systemd capture consumer stdout and stderr, and those files grow with every message and every error. Set rotation and a retention period that fits your incident response needs, and keep the logs free of message bodies and personal data where possible. Confirm with your security team how long worker logs must be kept and who can read them, since contact data can appear in error traces.

Fix file ownership before workers fail

A consumer that cannot write to the cache or log directories often fails on a message and then retries in a loop, which looks like a queue problem. After every deployment, update, or change of user, check that the consumer account owns or can write the directories Mautic uses for cache and logs, and that the web server user can still read them. Make this check part of the deployment runbook so ownership errors do not reach production.

Questions teams ask before scaling Mautic queue workers

What does it cost to scale Mautic queue workers?

The cost comes from the people doing the work, the infrastructure the workers run on, and the recurring effort to keep them healthy. Effort rises with the number of transports you run, how many consumers you need, whether the queue service is self-hosted or managed, and how much monitoring and alerting you require. Your own team pays for internal hours and any new servers or managed queue services. A partner's quote should follow from a written scope that names the transport, the number of consumers, the process manager and the failure handling. Ask for each cost line separately so one-time build work and recurring operations stay visible.

How long does a queue worker setup take?

Duration depends mainly on the transport, the environment and how much of the surrounding setup is already in place. A Doctrine transport on a single server with an existing process manager is a smaller job than a Redis or Amazon SQS setup that needs network access, credentials, separate worker hosts and a failure queue. Time also grows with load testing, because consumer counts can only be settled once you measure real email and hit volumes. Confirm the timeline in writing with your partner, and ask which steps depend on your hosting team, your email provider or your security review.

What does our internal team need to provide?

Your team needs to provide hosting access, a transport decision, and the details of your email provider. Hosting access means SSH or configuration rights on the Mautic servers, and rights to create or change services under your process manager. The transport decision covers whether you use Doctrine, Redis, AMQP, Beanstalkd or Amazon SQS, and where that service runs. Email provider details include the sending transport, rate limits and any bounce or complaint handling you already use. You should also name an owner for cron jobs, the messenger consumer and the failure queue, plus someone who can approve changes to production.

Can our internal team set up queue workers without outside help?

Yes, a team with Linux, PHP and queue operations experience can set up Mautic messenger consumers itself. The work requires that someone understands the Symfony messenger model, can read Mautic's cron and consumer documentation, and can configure Supervisor or systemd. Where teams struggle is in the less visible parts: choosing retry limits, making sure failed messages are kept, sizing workers against the database and mail provider, and testing that a restart does not lose messages. Decide early whether you have that skill across your team, not just in one person, and plan a review before the instance carries live campaigns.

How do we know the queue is the bottleneck?

Look for messages that wait longer than they should while the server has spare CPU, memory and database capacity. Check whether the number of queued messages keeps rising during peak sends, and whether emails for a campaign arrive late even though the broadcast and campaign cron jobs have run on time. Compare queue depth with consumer activity in your process manager logs. If the database or mail provider is the limit, adding consumers will not help and may make it worse. Measure before you add workers, and record the queue depth, send times and error counts for at least one full campaign cycle.

What recurring work follows a scaled queue setup?

A scaled setup needs ongoing checks on consumer health, the failure queue and the cron jobs that feed it. Someone should review failed messages, decide which to retry, and fix the cause before retrying. Process manager configuration needs review after each Mautic upgrade, because the supported PHP versions and requirements change by release. Queue service capacity, disk use and credentials also need attention, and backups should cover any queue data you keep. Ask your partner whether this support is covered by a retainer, and how upgrades and testing are scheduled.

Which Mautic release should we plan the queue setup around?

Plan around a release line that is still in security support for your whole build window. Mautic 7.2 receives active and security support until 30 September 2026, and Mautic 7.3 is planned as the long-term support release with security support through 31 December 2027. Mautic 7.0 requires PHP 8.2, 8.3, 8.4 or 8.5. Confirm the release you run before choosing a transport, because consumer configuration and PHP versions can differ between lines. Check the Mautic releases page again before go-live, since release status can change.

What changes for your team after the workers are stable

Once the consumers are running reliably, the work shifts from building the queue to watching it. Assign someone to check the failure transport on a fixed schedule, and treat a growing failed-message count as an incident rather than background noise. Track the depth of the main queue alongside it, so you can see whether workers are keeping pace with the email sends, campaign actions and segment updates that Mautic queues. Confirm during setup which alert channel reaches the on-call person, and confirm which metric your chosen transport exposes, because monitoring tools differ in what they can read from Doctrine tables, Redis, AMQP, Beanstalkd or Amazon SQS.

Upgrades are the most common point where a stable worker setup stops being stable. After each Mautic upgrade, confirm that the consumer processes restarted against the new code, since a worker still holding old code can accept messages it no longer handles correctly. Check Supervisor or systemd status, the consumer log and the failure queue within the first hours after the change. Mautic's release cadence means patch, minor and major releases arrive on different timetables, so rechecks should follow the release line you run, not a calendar you assumed. The upgrade and recovery topics on this site cover the schema checks and rollback steps if a consumer stalls after an update.

Workers also share a schedule with backups and cleanup. A cleanup run or a large restore can add heavy database load while consumers are processing, so write down the windows in which each job runs and agree them with whoever owns the database. Ask your team to confirm that a backup has been restored and tested in a separate environment before any cleanup or update that touches the message tables. Review these schedules whenever contact volume grows, because the same timing that worked for a smaller instance can start producing timeouts and retries at higher volume.

How DeployOpen scopes and delivers Mautic queue worker work

DeployOpen plans queue worker changes for Mautic as a written, fixed-scope piece of work inside infrastructure you control. The work starts from your actual message volumes, transport choice and failure handling, then delivers tested worker configuration, documentation and an agreed support path.

How we scope

  • Review current messenger consumer setup, cron schedule and which queued email and segment jobs run on your instance
  • Agree the transport (Doctrine, Redis, AMQP, Beanstalkd or Amazon SQS) against your hosting and monitoring constraints
  • Write a fixed scope listing deliverables, environments covered, test cases and timelines before any work begins

How we build

  • Configure consumers under Supervisor or systemd with restart policies, concurrency limits and log locations you can audit
  • Set retry strategy and a failure queue so failed messages are kept for review and replay rather than silently dropped
  • Load test consumers against realistic volumes in a staging copy, then verify no messages are lost during worker restarts

How we hand over

  • Document worker units, transport settings, retry rules, failure queue procedure and the runbook for replaying failed messages
  • Walk your operations team through alerts, log checks and the steps to scale workers up or down safely
  • Provide a verification checklist your team can rerun after Mautic upgrades, PHP changes or server moves

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover
  • Retainer scope is agreed in writing, including which Mautic release line and transport changes it covers
  • Ask any partner to confirm how queue worker changes are tested before they reach your production instance

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.