Octane • Reminders in Long-Lived PHP • Service Container • Concurrent Tasks • Other Features in Octane • Blocking I/O in PHP • Coroutine • Benchmark • Q&A
risk causing memory leaks • Cons • States can't be shared between requests • States must rely on external storages • Resources can't be reused e ffi ciently • Connection cost is expensive (like database) • Not good for high performance
o ff i cial Laravel team • Supports Swoole and Roadrunner • Requires Laravel 8 and PHP 8 • Becoming more friendly in long-lived app • Hot reload support • Brings additional features
states will be shared in di ff erent requests. • Use global variables carefully unless you know what you’re doing in long-lived PHP. • You need to reset these states in the beginning of request if you don’t want to share them.
glue layer to call C functions • The I/O model is blocking by default • Almost all client-side libraries involving I/O are blocking • Multiple process for handling blocking I/O • I/O bound concurrency depends on process number • Cost for context switch in processes is expensive
database • No global variable modi fi cations in coroutines • Only one request in one worker at the same time • Still not e ff ective enough unless container supports coroutine Coroutine in Octane