Skip to content

Instantly share code, notes, and snippets.

@osbre
Last active April 9, 2025 23:51
Show Gist options
  • Save osbre/03944bfcf3354a4abf1e7be3b753ef3b to your computer and use it in GitHub Desktop.
Save osbre/03944bfcf3354a4abf1e7be3b753ef3b to your computer and use it in GitHub Desktop.

Forum Title:
Laravel bootstrap takes 200ms — what's the fix?


Jeen:
Hey, quick question — my Laravel bootstrap takes 200ms. What do people usually use to speed that up? RoadRunner?

Ivan Mykhavko:
OpenServer 😄

Max Grom: Symfony 😁

Jeen:
That kind of talk’ll get you banned in the Laravel chat 😂

Max Grom:
Then you didn’t install it right 🤝😁

Vlad:
OPcache

Azure Rock:
OpenServer

Vlad:
That big bootstrap time is probably because of Filament’s service providers

Ostap Brehin:
Octane with FrankenPHP

Jeen:
Oh, interesting. So does that store the interpreted bootstrap code in memory? Or the already executed one? Any issues with some packages?

Ostap Brehin:
“It boots the app once and just feeds it requests.”

Jeen:
Gonna read up on that, thanks.

Ostap Brehin:
php-fpm does the opposite — it gets to know the app on every request.

Jeen:
There’s also Swoole, right? Is that the same idea?

Ostap Brehin:
Yep.
It’s one of the adapters for Octane.
FrankenPHP is currently the fastest one.

Vitaliy Sheverov:
@jeen_jeens just keep in mind memory management — you don’t want crashes with those “new” approaches. Not every PHP app is ready for that.

Ostap Brehin:
There were compatibility issues with Filament over a year ago, but they should’ve been fixed.
Checked GitHub, a few changes were made since.
@jeen_jeens Honestly, try enabling OPcache first — might be enough (depends on the case).

Jeen:
I’ve got OPcache enabled.

Ostap Brehin:
Hmm, that’s a seriously heavy bootstrap (200ms).
Could the DB connection be taking that time?
Or maybe file system reads for caching?
Try switching cache to Redis.
And session storage too.

Vlad:
Yeah that bootstrap time’s way too high.

Ostap Brehin:
My guess: cache and sessions are using the file driver.

Jeen:
Possibly, I’ll take a closer look.

Max Grom:
Just having it enabled isn’t always enough. Still worth analyzing whether the settings are right.

Azure Rock:
So wait, are you all actually using Octane in production already?

Йірдна Кучварк:
Nah, still on propane-butane for now 😁

--

The above discussion was extracted and translaetd from the Laravel UA community chat. Join us on Telegram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment