3 ms·
It would seem that this is more or less an alternative to Octane but I don't understand why there is documentation to also run Octane -> https://frankenphp.dev/
by thomasfromcdnjs 2y ago
It would seem that this is more or less an alternative to Octane but I don't understand why there is documentation to also run Octane -> https://frankenphp.dev/docs/laravel/#laravel-octane/ https://frankenphp.dev/docs/laravel/#laravel-octane/
Why would you run both?
- francislavoie 2y agoIt's not an "alternative", FrankenPHP is one of the 3 available drivers for Octane. See the Laravel docs https://laravel.com/docs/11.x/octane https://laravel.com/docs/11.x/octane Octane is basically Laravel's branding for its "worker mode", i.e. running a long-running process which boots the framework and then processes requests, without needing to reboot the framework on every request.
- thomasfromcdnjs 2y agoThanks for the answer. So you would turn on Frankens worker mode to sit on top of Laravel Octanes workers? My understanding is that Franken keeps the app running so Laravel wouldn't need to restart anyway?
- francislavoie 2y agoNo, you use Octane to run FrankenPHP. Octane will download and run FrankenPHP for you. FrankenPHP is a program which has a webserver (Caddy) and PHP built-in, and worker mode allows it to run a pool of workers which have your Laravel app bootstrapped (all your service providers, middleware, controllers ready to go in memory) and then FrankenPHP feeds it requests as they come in.
- kuekacang 2y agoTo add, octane does a trick that, frow what i grasp from reading the source, it cap for a total of n request (200?) and kill the worker to preemptively free up ram
- yurishimo 2y agoThe Go container provides an environment in which to run Octane. Your webserver still needs to know to reroute traffic appropriately. You can think of FrankenPHP as more of a webserver/app server all bundled into one binary.