Skip to content

Tuning Exim queue runners under bursty mail load on cPanel

When mail arrives in bursts — newsletter blasts, transactional spikes, post-incident notifications — Exim default queue runners cannot keep up. Here is how to size them on cPanel.

Exim on cPanel is configured with conservative defaults that assume a quiet mail flow. When a customer fires a newsletter to 50,000 recipients, or a transactional service retries deferred mail in waves, the queue grows faster than the runners can process it. The mail itself is fine; the delivery is just delayed by hours or days. The fix is to size queue runners and parallelism to the actual workload, not the default.

What’s happening

Exim’s queue_run is what processes deferred or queued messages. By default, cPanel runs exim -q1h every hour — one queue run per hour, single-threaded. On a quiet host that is fine. On a host where a customer just queued 50,000 messages, that is one run per hour processing maybe 1000 messages each — 50 hours to clear the queue.

The relevant Exim knobs are: queue_run_max (how many parallel runners), remote_max_parallel (concurrent SMTP deliveries per host), smtp_accept_max_per_connection, and the cron interval. cPanel sets some of these from WHM > Exim Configuration Manager. Others require editing /etc/exim.conf.local.

How to verify

Current queue size and age distribution:

exim -bpc
exim -bp | head -20
exim -bp | awk '{print $1}' | sort | uniq -c

Per-message queue runner stats:

ps auxf | grep 'exim -q'
tail -200 /var/log/exim_mainlog | grep 'starting queue run'
exim -bp -bpr | head -20

If you see only one exim -q process running and the queue size is in the tens of thousands, you have a runner-count problem. If you see many exim -q processes but the queue is still growing, the bottleneck is downstream (slow remote MTA, DNS resolution, TLS handshake).

The fix

  1. Raise queue runner parallelism. In WHM > Exim Configuration Manager > Advanced Editor, set queue_run_max = 30 (or higher; up to ~50 on a busy host).
  2. Raise concurrent remote deliveries. remote_max_parallel = 20 lets a single runner send to 20 recipients in parallel. Combined with queue_run_max, the host can have hundreds of concurrent outbound connections.
  3. Adjust the cron interval. cPanel’s default /etc/cron.d/exim runs exim -q1h. For a bursty host, switch to */15 * * * * exim -q — a queue run every 15 minutes.
  4. Smart-host the heavy senders. A customer doing 50k+ messages per day should not deliver direct-to-MX from a shared cPanel host. Route them through Postmark, Sendgrid, or a dedicated SMTP relay. The cPanel-side change is a single transport rule.
  5. Watch deferred-vs-frozen split. exim -bp shows messages with a * (frozen) flag separately. A growing frozen queue means delivery failures that need attention, not just slow runners.

After tuning, watch the queue size every 5 minutes during a burst event. Steady or shrinking = configuration is sized right; growing = need more parallelism or a different routing strategy. Stack Harbor handles mail flow tuning as part of cPanel/WHM management.