Slow worker startup using k8s + Laravel Octane #1124
Replies: 2 comments
-
Caddy should be starting pretty fast from my experience. According to your logs Caddy is ready to handle requests at Does your Laravel application maybe do some complicated setup that takes that long? The main difference in Octane between Swoole and FrankenPHP ist that Swoole will boot all workers immediately, but FrankenPHP will boot workers when they receive their first request (not sure why it was implemented that way in Octane). |
Beta Was this translation helpful? Give feedback.
-
Ah that might explain it, we have a 10s initialDelay configured in k8s before the readinessProbe starts, so with Swoole the workers would boot in that time. But now with FrankenPHP it's sitting basically idle in those 10s and only when the readinessProbes starts the boot up happens. |
Beta Was this translation helpful? Give feedback.
-
We're trying out FrankenPHP for a Laravel App that previously ran on Octane with OpenSwoole.
After switching to FrankenPHP, we're seeing the first requests to workers take ~8s to boot / start up the worker.
Is this normal or are we doing something stupid?
Below is the first log lines of a pod after starting up:
With OpenSwoole, we used pods that got 0.2 CPU request, 1 CPU limit and 900MB memory request, 1200MB limit.
Using the exact same pod spec for FrankenPHP, our readiness probes failed and pods never got to ready, as the timeout was set to the default of 1s.
Increasing CPU request to 2 and RAM to 2000MB, and fixing the worker count to 1 did not make a difference, the first request still takes ~8 seconds.
Is there anything we can do to bring down the worker startup time?
Beta Was this translation helpful? Give feedback.
All reactions