3 ms·
> A request comes in, the PHP process loads up everything, executes the request and tears down...on every single request. It's called the "shared nothing archi
by alphadevx 11y ago
> A request comes in, the PHP process loads up everything, executes the request and tears down...on every single request.
It's called the "shared nothing architecture", and its by design. Nothing is shared between requests, so why _not_ tear down?
That model actually has a lot of benefits for web applications (it scales very well), and I consider it one of PHP's strong points.
- brightball 11y agoI do to, except with heavy frameworks.
- alphadevx 11y agoYep you're right, its the framework bootstrapping that's the killer, especially when those frameworks are expensively parsing config files each time (Yaml, XML...).
- spdionis 11y agoWhich modern frameworks never do. The parsed data is usually cached in a php file. Then the (compiled to bytecode) files are cached in opcache. The interpreter doesn't even hit the filesystem on every request.