luzrain/workerman-bundle
Symfony bundle integrating Workerman, the async event-driven PHP server, so you can run HTTP, WebSocket, and custom workers configured through Symfony's dependency injection and managed with console commands.
Architecture fit. Unchanged by v0.4.0. This is a Symfony bundle, not a Laravel package. It ships a Kernel-oriented runtime that boots a Symfony application inside a Workerman worker loop. Laravel's equivalent seam is the Octane worker contract (Laravel\Octane\Contracts\OperationTerminated / the Worker bootstrap), a different abstraction. There is no service provider, no config publish, no Laravel-facing API. Adopting this in a Laravel codebase means writing and owning a bridge layer — a custom Octane-style driver or a bespoke Workerman\Worker bootstrap that constructs Laravel's Application, handles request conversion, and manages the sandboxed container lifecycle. That bridge is the real deliverable, not the package.
Practical implication: the package is reference material and a dependency for its Workerman process-management and PSR-7/HttpFoundation glue, not a drop-in. Budget ~1–2 engineer-weeks for a spike and a hardened bridge, plus ongoing ownership. Nothing in v0.4.0 reduces that.
Integration feasibility. Low-to-moderate, still gated on a clear reason to move off the default. Laravel Octane already covers Swoole, RoadRunner, and FrankenPHP — all with first-party support. Workerman's genuine differentiators remain narrow but real: pure PHP with no C extension, Windows support, and a mature ecosystem (GatewayWorker, webman) for socket/long-connection workloads. If the ask is "HTTP request throughput," Octane's existing drivers win on fit and support. If the ask is "a persistent-connection/WebSocket tier in PHP without Swoole," this becomes interesting — but then you are probably reaching for Workerman directly, not this bundle.
What v0.4.0 changes. Two items, both incremental:
reuse_port configuration option (SO_REUSEPORT). Lets multiple independent master processes bind the same listening port, which is directly relevant to two things we flagged as operational weaknesses: zero-dropped-request deploys and multi-pool scaling without a single master as a bottleneck. This is a real capability, not cosmetic. Caveats: it is Linux-kernel-dependent, requires consistent socket options across all listeners, and gives you kernel-level load distribution with no visibility from the application — uneven connection distribution becomes a debugging problem you own.Neither item touches the core finding: the Laravel bridge is still ours to build and maintain.
Technical risk.
octane:status, event hooks, Telescope integration) observability is on us.SO_REUSEPORT semantics add a failure mode we did not previously carry — port-sharing conflicts and skewed connection distribution that are invisible at the app layer.Key questions for the team.
register_shutdown_function, exit, global state, or per-request static caches that assume a fresh process?Stack fit. Poor out of the box, moderate with investment. The package assumes Symfony's kernel lifecycle; Laravel's is adjacent but not compatible. Expect to vendor or fork the HttpFoundation/PSR-7 conversion pieces and reimplement the kernel-boot logic against Illuminate\Foundation\Application.
Migration path. Do not attempt a wholesale runtime swap. Sequence it:
Compatibility. Verify PHP version constraints and ext-* requirements against our platform images before anything else — Workerman 5 raises the PHP floor relative to 4, so confirm our oldest in-support runtime still qualifies. Confirm the bundle's Workerman constraint is an explicit major pin and not a range. Check compatibility with our Laravel major, with Octane if co-installed, and with middleware that assumes $_SERVER/php://input semantics. Confirm behavior under our process supervisor (systemd vs. container tini) — Workerman manages its own master/worker tree and fights naive supervisors.
Where reuse_port fits. Treat it as a deploy-time and scaling lever, not an integration shortcut. If adopted: validate on our target kernel, confirm consistent socket options across every listener, and load-test for connection distribution skew before relying on it for zero-downtime reload. It does not remove the need for graceful-reload testing; it changes the shape of it.
Sequencing and gates. Gate 1: benchmark shows a measured win over Octane. Gate 2: bridge passes the existing integration suite with workers running 10k+ requests without memory growth, on a pinned Workerman 5. Gate 3: 30 days in a canary with no state-leak incidents. Gate 4 (only if reuse_port is used): documented zero-dropped-request deploy and measured distribution evenness. Each gate is a stop point.
Maintenance. The dominant ongoing cost is not the dependency, it is our bridge. Assume we own it permanently and that upstream will not accept Laravel-specific PRs. Budget a standing few engineer-days per quarter for PHP/Laravel upgrades and Workerman API drift, plus a documented fork policy so the work survives team turnover. v0.4.0 is a genuine positive on this axis — the maintainer shipped a current-major upgrade rather than letting the package rot — but it does not transfer ownership of the Laravel-side integration to them.
Support. No commercial support, no meaningful community to escalate to. Escalation path is: our fork, then Workerman internals. Contrast with Octane, where failure modes are documented and searchable. This materially changes incident MTTR and should be stated plainly to whoever signs off. Note also that Workerman 5 failure modes are less represented in existing write-ups than 4.
Scaling. Workerman's model is fixed worker pools per process manager — scale by replica count or by count in worker config. Memory-per-worker is higher than FPM and does not shrink; a leak becomes an OOM kill rather than slow degradation. Horizontal scaling works normally behind a load balancer; sticky sessions needed if any in-process state is held. Cold-start of a pool is slower than FPM — factor into burst handling. reuse_port opens a second scaling topology (multiple independent masters on one port), which is useful but adds a layer of operational reasoning the team did not previously need.
Failure modes to instrument before launch.
max_request recycling as a safety valve.reuse_port is enabled, track per-listener accept counts and alert on sustained imbalance; SO_REUSEPORT will not do this for you.Ramp-up. Expect 2–3 weeks before an engineer is productive debugging this stack: Workerman's process model, fork/reload semantics, and the Laravel container sandbox are three overlapping mental models, and there is little Laravel-specific material to learn from. That cost is incurred by every future on-call engineer — the strongest argument for keeping this scoped to a single isolated tier if it is adopted at all.
Recommendation. Unchanged in direction. Default to no for the main HTTP tier — Octane's existing drivers dominate on fit, support, and risk. Evaluate only against a specific unmet requirement (Windows deployment, no-C-extension constraint, or a WebSocket/gateway tier), and only via the benchmark-first sequence above. v0.4.0 modestly improves the maintenance and deploy story and is the strongest signal yet that the package is alive; it does not change the economics of the bridge we would have to own. If the requirement is real, the honest framing for stakeholders remains: we are adopting Workerman and building a thin Laravel bridge, with this bundle as a partial reference — not we are adopting a package.
How can I help you explore Laravel packages today?