26 ms·
I have a theory that PHP is kind of like erlang -- as a framework and dev environment, not the language itself. Each request is pretty much independent of the
by jeffdavis 6y ago
I have a theory that PHP is kind of like erlang -- as a framework and dev environment, not the language itself.
Each request is pretty much independent of the others, and each one can independently crash.
There was also CGI, but CGI always felt a little heavier, and the crashes were harsher (usually just a 501 error and nothing more). PHP embraced the crashes more and provided more information allowing faster debugging.
As a result, generally it was pretty easy to make resilient software.
Critically, PHP also embraced SQL databases, so that crashing meant aborting the transaction (if any). Erlang never meshed quite as well with transactional databases, so trying to keep consistent shared state in erlang felt tricky. In PHP, it was natural.
- BiteCode_dev 6y ago> Each request is pretty much independent of the others, and each one can independently crash. Not the case anymore with phpfpm.
- jbboehr 6y agophp-fpm uses a worker pool. How is this true unless you corrupt the shared memory segment?
- BiteCode_dev 6y agoI haven't checked it, but I think the worker stays up, and deal with several requests during its life time, not just one then die. Hence, there is pesistence.
- jbboehr 6y agoAs long as there is nothing broken in internals (a very big if, to be fair), user code crashing will not affect subsequent requests.