Skip to main content
SyliusPHPRAM
SyliusPHPRAM Partner Disclosure: Outbound /go/ links marked rel="sponsored" may earn a referral commission at zero extra cost (Partner Disclosure).
Stack Matrix Hub (9)

Symfony Messenger Async Consumers for Sylius Emails & Webhooks

Move order confirmation emails, ERP webhooks, and catalog syncs off checkout HTTP threads into bounded Redis-backed Messenger daemons.

145-195 MB/consumer · --memory-limit=192M · Checkout P95 < 140 ms

Symfony Messenger Async Consumers for Sylius Emails & Webhooks
Telemetry verified 2026-11-04 by SymfonyCart Matrix.

Why Synchronous SMTP & ERP Calls Starve Checkout Pools

When a flash sale triggers 40 checkouts per second, sending Twig-rendered order emails or calling external ERP webhooks synchronously holds PHP-FPM or FrankenPHP worker threads open for 400 to 1,800 ms per order. Routing SendEmailMessage and UpdateProductMessage to Redis streams keeps web threads sub-140 ms.

Enforcing --memory-limit and --time-limit on Long-Lived Consumers

Always run messenger:consume async with --time-limit=3600 and --memory-limit=192M under systemd or Supervisor. Add doctrine_close_connection and doctrine_clear_entity_manager middleware so accumulated entities never trigger Linux OOM kills.

Measured Thresholds & Configuration

Queue ProfileRecommended ConsumersMemory Limit FlagTotal Async RAM Budget
10k SKU Store (< 200 orders/hr)2 async workers--memory-limit=160M320 MB
50k SKU Store (200-1,000 orders/hr)3 - 4 async workers--memory-limit=192M576 - 768 MB
100k+ B2B ERP + Catalog Sync4 - 6 async workers--memory-limit=224M896 - 1,344 MB
145-195 MB/consumer · --memory-limit=192M · Checkout P95 < 140 ms Launch ChemiCloud ($4.49/mo)UltaHost VDS ($41.50/mo)